19 #include <deal.II/base/config.h>
21 #include <deal.II/base/exceptions.h>
23 #ifdef DEAL_II_COMPILER_CUDA_AWARE
24 # include <cusolverDn.h>
25 # include <cusolverSp.h>
26 # include <cusparse.h>
30 DEAL_II_NAMESPACE_OPEN
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>
133 cudaError_t cuda_error_code = cudaMemcpy(vector_host.data(),
135 vector_host.size() *
sizeof(T),
136 cudaMemcpyDeviceToHost);
144 template <
typename T>
148 cudaError_t cuda_error_code = cudaMemcpy(pointer_dev,
150 vector_host.size() *
sizeof(T),
151 cudaMemcpyHostToDevice);
157 DEAL_II_NAMESPACE_CLOSE