19 #include <deal.II/base/config.h> 21 #ifdef DEAL_II_WITH_CUDA 23 #include <deal.II/base/exceptions.h> 25 #include <cusolverDn.h> 26 #include <cusolverSp.h> 30 DEAL_II_NAMESPACE_OPEN
60 cusolverDnHandle_t cusolver_dn_handle;
62 cusolverSpHandle_t cusolver_sp_handle;
74 inline void malloc(T *&pointer,
const unsigned int n_elements)
76 cudaError_t cuda_error_code = cudaMalloc(&pointer, n_elements *
sizeof(T));
84 inline void free(T *&pointer)
86 cudaError_t cuda_error_code = cudaFree(pointer);
96 std::vector<T> &vector_host)
98 cudaError_t cuda_error_code =
99 cudaMemcpy(vector_host.data(), pointer_dev,
100 vector_host.size() *
sizeof(T), cudaMemcpyDeviceToHost);
108 template <
typename T>
112 cudaError_t cuda_error_code =
113 cudaMemcpy(pointer_dev, vector_host.data(),
114 vector_host.size() *
sizeof(T), cudaMemcpyHostToDevice);
120 DEAL_II_NAMESPACE_CLOSE
void malloc(T *&pointer, const unsigned int n_elements)
void copy_to_dev(const std::vector< T > &vector_host, T *pointer_dev)
cusparseHandle_t cusparse_handle
#define AssertCuda(error_code)
void copy_to_host(const T *pointer_dev, std::vector< T > &vector_host)