Reference documentation for deal.II version GIT relicensing-837-gaf73e64026 2024-06-15 22:40:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
cuda.cc
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2018 - 2022 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#include <deal.II/base/cuda.h>
18
22#include <deal.II/lac/vector_memory.templates.h>
23
25
26namespace Utilities
27{
28 namespace CUDA
29 {
31 {
32 cusolverStatus_t cusolver_error_code =
33 cusolverDnCreate(&cusolver_dn_handle);
34 AssertCusolver(cusolver_error_code);
35
36 cusolver_error_code = cusolverSpCreate(&cusolver_sp_handle);
37 AssertCusolver(cusolver_error_code);
38
39 cusparseStatus_t cusparse_error_code = cusparseCreate(&cusparse_handle);
40 AssertCusparse(cusparse_error_code);
41 }
42
43
44
46 {
47 cusolverStatus_t cusolver_error_code =
48 cusolverDnDestroy(cusolver_dn_handle);
49 AssertCusolver(cusolver_error_code);
50
51 cusolver_error_code = cusolverSpDestroy(cusolver_sp_handle);
52 AssertCusolver(cusolver_error_code);
53
54 cusparseStatus_t cusparse_error_code = cusparseDestroy(cusparse_handle);
55 AssertCusparse(cusparse_error_code);
56 }
57 } // namespace CUDA
58} // namespace Utilities
59
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
#define AssertCusparse(error_code)
#define AssertCusolver(error_code)
Default CUDA
cusolverDnHandle_t cusolver_dn_handle
Definition cuda.h:64
cusolverSpHandle_t cusolver_sp_handle
Definition cuda.h:70
cusparseHandle_t cusparse_handle
Definition cuda.h:76