QMCPACK
CUDAHandles Struct Reference

Doesn't depend on the resource management scheme thats out of scope for unit tests. More...

+ Collaboration diagram for CUDAHandles:

Public Member Functions

 CUDAHandles ()
 
 CUDAHandles (const CUDAHandles &)
 
 ~CUDAHandles ()
 

Public Attributes

cudaStream_t hstream
 
cublasHandle_t h_cublas
 

Detailed Description

Doesn't depend on the resource management scheme thats out of scope for unit tests.

Definition at line 43 of file test_cuBLAS_LU.cpp.

Constructor & Destructor Documentation

◆ CUDAHandles() [1/2]

CUDAHandles ( )
inline

Definition at line 49 of file test_cuBLAS_LU.cpp.

References cublasCreate, cublasErrorCheck, cublasSetStream, qmcplusplus::cudaErrorCheck(), cudaStreamCreate, CUDAHandles::h_cublas, and CUDAHandles::hstream.

50  {
51  cudaErrorCheck(cudaStreamCreate(&hstream), "cudaStreamCreate failed!");
52  cublasErrorCheck(cublasCreate(&h_cublas), "cublasCreate failed!");
53  cublasErrorCheck(cublasSetStream(h_cublas, hstream), "cublasSetStream failed!");
54  }
#define cudaStreamCreate
Definition: cuda2hip.h:150
cudaErrorCheck(cudaMemcpyAsync(dev_lu.data(), lu.data(), sizeof(decltype(lu)::value_type) *lu.size(), cudaMemcpyHostToDevice, hstream), "cudaMemcpyAsync failed copying log_values to device")
#define cublasCreate
Definition: cuda2hip.h:37
#define cublasSetStream
Definition: cuda2hip.h:39
#define cublasErrorCheck(ans, cause)
Definition: cuBLAS.hpp:34

◆ CUDAHandles() [2/2]

CUDAHandles ( const CUDAHandles )
inline

Definition at line 56 of file test_cuBLAS_LU.cpp.

◆ ~CUDAHandles()

~CUDAHandles ( )
inline

Definition at line 58 of file test_cuBLAS_LU.cpp.

References cublasDestroy, cublasErrorCheck, qmcplusplus::cudaErrorCheck(), cudaStreamDestroy, CUDAHandles::h_cublas, and CUDAHandles::hstream.

59  {
60  cublasErrorCheck(cublasDestroy(h_cublas), "cublasDestroy failed!");
61  cudaErrorCheck(cudaStreamDestroy(hstream), "cudaStreamDestroy failed!");
62  }
#define cudaStreamDestroy
Definition: cuda2hip.h:151
#define cublasDestroy
Definition: cuda2hip.h:38
cudaErrorCheck(cudaMemcpyAsync(dev_lu.data(), lu.data(), sizeof(decltype(lu)::value_type) *lu.size(), cudaMemcpyHostToDevice, hstream), "cudaMemcpyAsync failed copying log_values to device")
#define cublasErrorCheck(ans, cause)
Definition: cuBLAS.hpp:34

Member Data Documentation

◆ h_cublas

cublasHandle_t h_cublas

Definition at line 47 of file test_cuBLAS_LU.cpp.

Referenced by CUDAHandles::CUDAHandles(), and CUDAHandles::~CUDAHandles().

◆ hstream

cudaStream_t hstream

Definition at line 46 of file test_cuBLAS_LU.cpp.

Referenced by CUDAHandles::CUDAHandles(), and CUDAHandles::~CUDAHandles().


The documentation for this struct was generated from the following file: