ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
gpu_runtime.h
Go to the documentation of this file.
1#ifndef GPU_RUNTIME_H_
2#define GPU_RUNTIME_H_
3
17#if defined(__CUDA)
18
19#include <cuda_runtime.h>
20
21// Error handling
22#define gpuError_t cudaError_t
23#define gpuSuccess cudaSuccess
24#define gpuGetErrorString cudaGetErrorString
25
26// Device management
27#define gpuGetDeviceCount cudaGetDeviceCount
28#define gpuGetDevice cudaGetDevice
29#define gpuSetDevice cudaSetDevice
30#define gpuGetDeviceProperties cudaGetDeviceProperties
31#define gpuDeviceProp_t cudaDeviceProp
32
33// Version info
34#define gpuDriverGetVersion cudaDriverGetVersion
35#define gpuRuntimeGetVersion cudaRuntimeGetVersion
36
37// Peer access
38#define gpuDeviceCanAccessPeer cudaDeviceCanAccessPeer
39
40// Error check macro
41#define gpuErrcheck CHECK_CUDA
42
43#elif defined(__ROCM)
44
45#include <hip/hip_runtime.h>
46
47// Error handling
48#define gpuError_t hipError_t
49#define gpuSuccess hipSuccess
50#define gpuGetErrorString hipGetErrorString
51
52// Device management
53#define gpuGetDeviceCount hipGetDeviceCount
54#define gpuGetDevice hipGetDevice
55#define gpuSetDevice hipSetDevice
56#define gpuGetDeviceProperties hipGetDeviceProperties
57#define gpuDeviceProp_t hipDeviceProp_t
58
59// Version info
60#define gpuDriverGetVersion hipDriverGetVersion
61#define gpuRuntimeGetVersion hipRuntimeGetVersion
62
63// Peer access
64#define gpuDeviceCanAccessPeer hipDeviceCanAccessPeer
65
66// Error check macro
67#define gpuErrcheck CHECK_CUDA
68
69#endif // __CUDA / __ROCM
70
71#endif // GPU_RUNTIME_H_