fml  0.1-0
Fused Matrix Library
gpuprims.hh
1 // This file is part of fml which is released under the Boost Software
2 // License, Version 1.0. See accompanying file LICENSE or copy at
3 // https://www.boost.org/LICENSE_1_0.txt
4 
5 #ifndef FML_GPU_INTERNALS_CUDA_GPUPRIMS_H
6 #define FML_GPU_INTERNALS_CUDA_GPUPRIMS_H
7 #pragma once
8 
9 
10 #include <cublas.h>
11 #include <cusolverDn.h>
12 
13 
14 namespace gpuprims
15 {
16  inline cudaError_t gpu_device_reset()
17  {
18  return cudaDeviceReset();
19  }
20 
21  inline std::string gpu_error_string(cudaError_t code)
22  {
23  return cudaGetErrorString(code);
24  }
25 
26 
27 
28  inline cublasStatus_t gpu_blas_init(cublasHandle_t *handle)
29  {
30  return cublasCreate(handle);
31  }
32 
33  inline cublasStatus_t gpu_blas_free(cublasHandle_t handle)
34  {
35  return cublasDestroy(handle);
36  }
37 
38 
39 
40  inline cusolverStatus_t gpu_lapack_init(cusolverDnHandle_t *handle)
41  {
42  return cusolverDnCreate(handle);
43  }
44 
45  inline cusolverStatus_t gpu_lapack_free(cusolverDnHandle_t handle)
46  {
47  return cusolverDnDestroy(handle);
48  }
49 }
50 
51 
52 #endif
Definition: gpuprims.hh:14