NAMD
HipDefines.h
Go to the documentation of this file.
1 #ifndef HIPDEF_H
2 #define HIPDEF_H
3 #ifdef NAMD_HIP
4 // #define __ldg *
5 #ifndef NAMD_CUDA
6 #ifndef __align__
7 #define __align__ alignas
8 #endif
9 #define cudaGetDevice hipGetDevice
10 #define cudaGetDeviceCount hipGetDeviceCount
11 #define cudaSetDevice hipSetDevice
12 #define cudaSetDeviceFlags hipSetDeviceFlags
13 #define cudaDeviceReset hipDeviceReset
14 #define cudaDeviceMapHost hipDeviceMapHost
15 #define cudaDeviceProp hipDeviceProp_t
16 #define cudaGetDeviceProperties hipGetDeviceProperties
17 #define cudaDeviceGetStreamPriorityRange hipDeviceGetStreamPriorityRange
18 #define cudaStreamDefault hipStreamDefault
19 #define cudaStreamCreate hipStreamCreate
20 #define cudaStreamCreateWithPriority hipStreamCreateWithPriority
21 #define cudaStreamDestroy hipStreamDestroy
22 #define cudaStreamWaitEvent hipStreamWaitEvent
23 #define cudaStreamSynchronize hipStreamSynchronize
24 #define cudaDeviceSynchronize hipDeviceSynchronize
25 #define cudaStream_t hipStream_t
26 #define cudaDeviceCanAccessPeer hipDeviceCanAccessPeer
27 #define cudaDeviceEnablePeerAccess hipDeviceEnablePeerAccess
28 #define cudaErrorPeerAccessAlreadyEnabled hipErrorPeerAccessAlreadyEnabled
29 #define cudaDeviceEnablePeerAccess hipDeviceEnablePeerAccess
30 #define cudaDeviceDisablePeerAccess hipDeviceDisablePeerAccess
31 #define cudaComputeModeProhibited hipComputeModeProhibited
32 #define cudaComputeModeExclusive hipComputeModeExclusive
33 #define cudaResourceDesc hipResourceDesc
34 #define cudaDeviceGetP2PAttribute hipDeviceGetP2PAttribute
35 #define cudaDevP2PAttrNativeAtomicSupported hipDevP2PAttrNativeAtomicSupported
36 #define cudaIpcMemHandle_t hipIpcMemHandle_t
37 #define cudaDevAttrComputeMode hipDeviceAttributeComputeMode
38 //Events
39 #define cudaEventCreate hipEventCreate
40 #define cudaEventQuery hipEventQuery
41 #define cudaEventRecord hipEventRecord
42 #define cudaEventDestroy hipEventDestroy
43 #define cudaEventCreateWithFlags hipEventCreateWithFlags
44 #define cudaEventDisableTiming hipEventDisableTiming
45 #define cudaEventSynchronize hipEventSynchronize
46 #define cudaEvent_t hipEvent_t
47 #define cudaError_t hipError_t
48 #define cudaGetLastError hipGetLastError
49 #define cudaGetErrorString hipGetErrorString
50 //Status definitions
51 #define cudaSuccess hipSuccess
52 #define cudaErrorNotReady hipErrorNotReady
53 #define cudaErrorSetOnActiveProcess hipErrorSetOnActiveProcess
54 
55 //Textures
56 // NOTE: Textures are not supported on gfx94x targets
57 // If compiling for MI300 - Need to manually include -DUSE_TABLE_ARRAYS to CXXOPTS and CUDAOPTS
58 #ifndef USE_TABLE_ARRAYS
59 #define cudaTextureObject_t hipTextureObject_t
60 #define cudaAddressModeClamp hipAddressModeClamp
61 #define cudaFilterModePoint hipFilterModePoint
62 #define cudaFilterModeLinear hipFilterModeLinear
63 #define cudaCreateTextureObject hipCreateTextureObject
64 #define cudaBindTextureToArray hipBindTextureToArray
65 #define cudaBindTexture hipBindTexture
66 #define cudaDestroyTextureObject hipDestroyTextureObject
67 #define cudaArray hipArray
68 #define cudaArray_t hipArray_t
69 #define cudaChannelFormatDesc hipChannelFormatDesc
70 #define cudaChannelFormatKindFloat hipChannelFormatKindFloat
71 #define cudaResourceTypeArray hipResourceTypeArray
72 #define cudaTextureDesc hipTextureDesc
73 #define cudaResourceTypeLinear hipResourceTypeLinear
74 #endif
75 
76 //Memory management
77 #define cudaHostAllocMapped hipHostMallocMapped
78 #define cudaHostAlloc hipHostMalloc
79 #define cudaMemset hipMemset
80 #define cudaMemsetAsync hipMemsetAsync
81 #define cudaHostAllocDefault hipHostMallocDefault
82 #define cudaFree hipFree
83 #define cudaFreeArray hipFreeArray
84 #define cudaFreeHost hipHostFree
85 #define cudaMalloc hipMalloc
86 #define cudaMallocArray hipMallocArray
87 #define cudaMallocHost hipHostMalloc
88 #define cudaMallocManaged hipMallocManaged
89 #define cudaMemcpy hipMemcpy
90 #define cudaMemcpyAsync hipMemcpyAsync
91 #define cudaMemcpyPeerAsync hipMemcpyPeerAsync
92 #define cudaMemcpyToArray hipMemcpyToArray
93 #define cudaMemcpyHostToDevice hipMemcpyHostToDevice
94 #define cudaMemcpyDeviceToHost hipMemcpyDeviceToHost
95 #define cudaMemcpyDeviceToDevice hipMemcpyDeviceToDevice
96 #define cudaMemcpyToSymbol hipMemcpyToSymbol
97 #define cudaMemcpyToSymbolAsync hipMemcpyToSymbolAsync
98 #define cudaMemcpy3DAsync hipMemcpy3DAsync
99 #define cudaMemcpy3DParms hipMemcpy3DParms
100 #define cudaMemcpy3DPeerAsync hipMemcpy3DPeerAsync
101 #define cudaReadModeElementType hipReadModeElementType
102 #define cudaHostGetDevicePointer hipHostGetDevicePointer
103 #define cudaSharedMemBankSizeEightByte hipSharedMemBankSizeEightByte
104 #define cudaDeviceGetAttribute hipDeviceGetAttribute
105 #define cudaDevAttrMaxSharedMemoryPerBlockOptin hipDeviceAttributeSharedMemPerBlockOptin
106 #define cudaFuncAttributeMaxDynamicSharedMemorySize hipFuncAttributeMaxDynamicSharedMemorySize
107 #define cudaFuncSetAttribute hipFuncSetAttribute
108 #define make_cudaPos make_hipPos
109 #define make_cudaPitchedPtr make_hipPitchedPtr
110 #define make_cudaExtent make_hipExtent
111 //hiprand
112 #define curandGenerator_t hiprandGenerator_t
113 #define curandStatus_t hiprandStatus_t
114 #define curandDestroyGenerator hiprandDestroyGenerator
115 #define curandCreateGenerator hiprandCreateGenerator
116 #define curandSetPseudoRandomGeneratorSeed hiprandSetPseudoRandomGeneratorSeed
117 #define curandSetStream hiprandSetStream
118 #define curandGenerateNormal hiprandGenerateNormal
119 #define CURAND_STATUS_SUCCESS HIPRAND_STATUS_SUCCESS
120 #define CURAND_RNG_PSEUDO_DEFAULT HIPRAND_RNG_PSEUDO_DEFAULT
121 //hipfft
122 #define cufftHandle hipfftHandle
123 #define cufftType_t hipfftType_t
124 #define CUFFT_R2C HIPFFT_R2C
125 #define CUFFT_C2R HIPFFT_C2R
126 #define cufftExecC2R hipfftExecC2R
127 #define cufftExecR2C hipfftExecR2C
128 #define cufftResult hipfftResult
129 #define cufftPlan3d hipfftPlan3d
130 #define CUFFT_SUCCESS HIPFFT_SUCCESS
131 #define cufftReal hipfftReal
132 #define cufftPlanMany hipfftPlanMany
133 #define cufftSetStream hipfftSetStream
134 #define cufftDestroy hipfftDestroy
135 #define CUFFT_C2C HIPFFT_C2C
136 #define cufftComplex hipfftComplex
137 #define CUFFT_FORWARD HIPFFT_FORWARD
138 #define cufftExecC2C hipfftExecC2C
139 #define CUFFT_INVERSE HIPFFT_BACKWARD
140 #endif
141 #endif
142 #endif