24#ifdef DEAL_II_WITH_CUDA
25# include <cusolverDn.h>
26# include <cusolverSp.h>
85 malloc(T *&pointer,
const unsigned int n_elements)
87 cudaError_t cuda_error_code =
88 cudaMalloc(&pointer, n_elements *
sizeof(T));
99 cudaError_t cuda_error_code = cudaFree(pointer);
107 template <
typename Number>
119 template <
typename Number>
123 const cudaError_t error_code = cudaFree(device_ptr);
130 template <
typename T>
136 cudaError_t cuda_error_code = cudaMemcpy(out.
data(),
138 in.
size() *
sizeof(T),
139 cudaMemcpyDeviceToHost);
146 template <
typename T>
152 cudaError_t cuda_error_code = cudaMemcpy(out.
data(),
154 in.
size() *
sizeof(T),
155 cudaMemcpyHostToDevice);
162 template <
typename T>
175 template <
typename T>
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, 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
cusolverSpHandle_t cusolver_sp_handle
Handle(Handle const &)=delete
cusparseHandle_t cusparse_handle