Skip to content

Commit d1cf7d0

Browse files
committed
GPU: Add comments
1 parent 1baee2a commit d1cf7d0

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

GPU/Common/GPUCommonDefAPI.h

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,28 @@
2323
//All host-functions in GPU code are automatically inlined, to avoid duplicate symbols.
2424
//For non-inline host only functions, use no keyword at all!
2525
#if !defined(GPUCA_GPUCODE) || defined(__OPENCL_HOST__) // For host / ROOT dictionary
26-
#define GPUd()
27-
#define GPUdDefault()
28-
#define GPUdi() inline
29-
#define GPUdii()
30-
#define GPUh()
31-
#define GPUhi() inline
32-
#define GPUhd()
33-
#define GPUhdi() inline
34-
#define GPUhdni()
35-
#define GPUg() INVALID_TRIGGER_ERROR_NO_HOST_CODE
36-
#define GPUshared()
37-
#define GPUglobal()
38-
#define GPUconstant()
39-
#define GPUconstexpr() static constexpr
40-
#define GPUprivate()
41-
#define GPUgeneric()
42-
#define GPUbarrier()
43-
#define GPUAtomic(type) type
26+
#define GPUd() // device function
27+
#define GPUdDefault() // default (constructor / operator) device function
28+
#define GPUdi() inline // to-be-inlined device function
29+
#define GPUdii() // Only on GPU to-be-inlined device function
30+
#define GPUh() // Host-only function
31+
#define GPUhi() inline // to-be-inlined host-only function
32+
#define GPUhd() // Host and device function, inlined during GPU compilation to avoid symbol clashes in host code
33+
#define GPUhdi() inline // Host and device function, to-be-inlined on host and device
34+
#define GPUhdni() // Host and device function, not to-be-inlined automatically
35+
#define GPUg() INVALID_TRIGGER_ERROR_NO_HOST_CODE // GPU kernel
36+
#define GPUshared() // shared memory variable declaration
37+
#define GPUglobal() // global memory variable declaration (only used for kernel input pointers)
38+
#define GPUconstant() // constant memory variable declaraion
39+
#define GPUconstexpr() static constexpr // constexpr on GPU that needs to be instantiated for dynamic access (e.g. arrays), becomes __constant on GPU
40+
#define GPUprivate() // private memory variable declaration
41+
#define GPUgeneric() // reference / ptr to generic address space
42+
#define GPUbarrier() // synchronize all GPU threads in block
43+
#define GPUAtomic(type) type // atomic variable type
44+
#define GPUsharedref() // reference / ptr to shared memory
45+
#define GPUglobalref() // reference / ptr to global memory
46+
#define GPUconstantref() // reference / ptr to constant memory
47+
#define GPUconstexprref() // reference / ptr to variable declared as GPUconstexpr()
4448

4549
struct float4 { float x, y, z, w; };
4650
struct float3 { float x, y, z; };

0 commit comments

Comments
 (0)