23#ifdef DEAL_II_WITH_CUDA
24# include <cusolverDn.h>
25# include <cusolverSp.h>
84 malloc(T *&pointer,
const unsigned int n_elements)
86 cudaError_t cuda_error_code =
87 cudaMalloc(&pointer, n_elements *
sizeof(T));
98 cudaError_t cuda_error_code = cudaFree(pointer);
106 template <
typename Number>
118 template <
typename Number>
122 const cudaError_t error_code = cudaFree(device_ptr);
129 template <
typename T>
135 cudaError_t cuda_error_code = cudaMemcpy(out.
data(),
137 in.
size() *
sizeof(T),
138 cudaMemcpyDeviceToHost);
145 template <
typename T>
151 cudaError_t cuda_error_code = cudaMemcpy(out.
data(),
153 in.
size() *
sizeof(T),
154 cudaMemcpyHostToDevice);
161 template <
typename T>
174 template <
typename T>
ArrayView< std::remove_reference_t< typename std::iterator_traits< Iterator >::reference >, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
value_type * data() const noexcept
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define AssertNothrowCuda(error_code)
#define AssertDimension(dim1, dim2)
#define AssertCuda(error_code)
void malloc(T *&pointer, const unsigned int n_elements)
Number * allocate_device_data(const std::size_t size)
void delete_device_data(Number *device_ptr) noexcept
void copy_to_host(const ArrayView< const T, MemorySpace::CUDA > &in, ArrayView< T, MemorySpace::Host > &out)
void copy_to_dev(const ArrayView< const T, MemorySpace::Host > &in, ArrayView< T, MemorySpace::CUDA > &out)
cusolverDnHandle_t cusolver_dn_handle
Handle(const Handle &)=delete
cusolverSpHandle_t cusolver_sp_handle
cusparseHandle_t cusparse_handle