|
28 | 28 | //All host-functions in GPU code are automatically inlined, to avoid duplicate symbols. |
29 | 29 | //For non-inline host only functions, use no keyword at all! |
30 | 30 | #if !defined(GPUCA_GPUCODE) || defined(__OPENCL_HOST__) || defined(__METAL_HOST__) || defined(__CPUDEVICE__) // For host / ROOT dictionary, and for the CPUDevice backend whose device code runs on the host |
31 | | - #define GPUd() // device function |
32 | | - #define GPUdDefault() // default (constructor / operator) device function |
33 | | - #define GPUhdDefault() // default (constructor / operator) host device function |
34 | | - #define GPUdi() inline // to-be-inlined device function |
35 | | - #define GPUdii() // Only on GPU to-be-inlined (forced) device function |
36 | | - #define GPUdni() // Device function, not-to-be-inlined |
37 | | - #define GPUdnii() inline // Device function, not-to-be-inlined on device, inlined on host |
38 | | - #define GPUh() // Host-only function |
| 31 | + #define GPUd() // device function |
| 32 | + #define GPUdDefault() // default (constructor / operator) device function |
| 33 | + #define GPUhdDefault() // default (constructor / operator) host device function |
| 34 | + #define GPUdi() inline // to-be-inlined device function |
| 35 | + #define GPUdii() // Only on GPU to-be-inlined (forced) device function |
| 36 | + #define GPUdni() // Device function, not-to-be-inlined |
| 37 | + #define GPUdnii() inline // Device function, not-to-be-inlined on device, inlined on host |
| 38 | + #define GPUh() // Host-only function |
39 | 39 | // NOTE: All GPUd*() functions are also compiled on the host during host compilation. |
40 | 40 | // The GPUh*() macros are for the rare cases of functions that you want to compile for the host during GPU compilation. |
41 | 41 | // Usually, you do not need the GPUh*() versions. If in doubt, use GPUd*()! |
42 | | - #define GPUhi() inline // to-be-inlined host-only function |
43 | | - #define GPUhd() // Host and device function, inlined during GPU compilation to avoid symbol clashes in host code |
44 | | - #define GPUhdi() inline // Host and device function, to-be-inlined on host and device |
45 | | - #define GPUhdni() // Host and device function, not to-be-inlined automatically |
46 | | - #define GPUg() INVALID_TRIGGER_ERROR_NO_GPU_CODE // GPU kernel |
47 | | - #define GPUshared() // shared memory variable declaration |
48 | | - #define GPUglobal() // global memory variable declaration (only used for kernel input pointers) |
49 | | - #define GPUconstant() // constant memory variable declaraion |
50 | | - #define GPUconstexpr() static constexpr // constexpr on GPU that needs to be instantiated for dynamic access (e.g. arrays), becomes __constant on GPU |
51 | | - #define GPUglobalconstexpr() constexpr // constexpr variable at program scope, needs the constant address space in MSL |
52 | | - #define GPUnoexcept() noexcept // noexcept where the backend supports it |
53 | | - #define GPUprivate() // private memory variable declaration |
54 | | - #define GPUgeneric() // reference / ptr to generic address space |
55 | | - #define GPUbarrier() // synchronize all GPU threads in block |
56 | | - #define GPUbarrierWarp() // synchronize threads inside warp |
57 | | - #define GPUAtomic(type) type // atomic variable type |
58 | | - #define GPUsharedref() // reference / ptr to shared memory |
59 | | - #define GPUglobalref() // reference / ptr to global memory |
60 | | - #define GPUconstantref() // reference / ptr to constant memory |
61 | | - #define GPUconstexprref() // reference / ptr to variable declared as GPUconstexpr() |
| 42 | + #define GPUhi() inline // to-be-inlined host-only function |
| 43 | + #define GPUhd() // Host and device function, inlined during GPU compilation to avoid symbol clashes in host code |
| 44 | + #define GPUhdi() inline // Host and device function, to-be-inlined on host and device |
| 45 | + #define GPUhdii() inline __attribute__((always_inline)) // Host and device function, to-be-inlined (forced) on host and device |
| 46 | + #define GPUhdni() // Host and device function, not to-be-inlined automatically |
| 47 | + #define GPUg() INVALID_TRIGGER_ERROR_NO_GPU_CODE // GPU kernel |
| 48 | + #define GPUshared() // shared memory variable declaration |
| 49 | + #define GPUglobal() // global memory variable declaration (only used for kernel input pointers) |
| 50 | + #define GPUconstant() // constant memory variable declaraion |
| 51 | + #define GPUconstexpr() static constexpr // constexpr on GPU that needs to be instantiated for dynamic access (e.g. arrays), becomes __constant on GPU |
| 52 | + #define GPUglobalconstexpr() constexpr // constexpr variable at program scope, needs the constant address space in MSL |
| 53 | + #define GPUnoexcept() noexcept // noexcept where the backend supports it |
| 54 | + #define GPUprivate() // private memory variable declaration |
| 55 | + #define GPUgeneric() // reference / ptr to generic address space |
| 56 | + #define GPUbarrier() // synchronize all GPU threads in block |
| 57 | + #define GPUbarrierWarp() // synchronize threads inside warp |
| 58 | + #define GPUAtomic(type) type // atomic variable type |
| 59 | + #define GPUsharedref() // reference / ptr to shared memory |
| 60 | + #define GPUglobalref() // reference / ptr to global memory |
| 61 | + #define GPUconstantref() // reference / ptr to constant memory |
| 62 | + #define GPUconstexprref() // reference / ptr to variable declared as GPUconstexpr() |
62 | 63 |
|
63 | 64 | #ifndef __VECTOR_TYPES_H__ // FIXME: ROOT will pull in these CUDA definitions if built against CUDA, so we have to add an ugly protection here |
64 | 65 | struct float4 { float x, y, z, w; }; |
|
88 | 89 | #define GPUhi() INVALID_TRIGGER_ERROR_NO_HOST_CODE |
89 | 90 | #define GPUhd() inline |
90 | 91 | #define GPUhdi() inline |
| 92 | + #define GPUhdii() __attribute__((always_inline)) inline |
91 | 93 | #define GPUhdni() |
92 | 94 | #define GPUg() __kernel |
93 | 95 | #define GPUshared() __local |
|
156 | 158 | #define GPUhi() inline |
157 | 159 | #define GPUhd() inline |
158 | 160 | #define GPUhdi() inline |
| 161 | + #define GPUhdii() inline __attribute__((always_inline)) |
159 | 162 | #define GPUhdni() |
160 | 163 | #define GPUg() kernel |
161 | 164 | #define GPUshared() threadgroup |
|
186 | 189 | #define GPUhi() __host__ inline |
187 | 190 | #define GPUhd() __host__ __device__ inline |
188 | 191 | #define GPUhdi() __host__ __device__ inline |
| 192 | + #define GPUhdii() __host__ __device__ __forceinline__ |
189 | 193 | #define GPUhdni() __host__ __device__ |
190 | 194 | #define GPUg() __global__ |
191 | 195 | #define GPUshared() __shared__ |
|
221 | 225 | #define GPUhi() __host__ inline |
222 | 226 | #define GPUhd() __host__ __device__ inline |
223 | 227 | #define GPUhdi() __host__ __device__ inline |
| 228 | + #define GPUhdii() __host__ __device__ __forceinline__ |
224 | 229 | #define GPUhdni() __host__ __device__ |
225 | 230 | #define GPUg() __global__ |
226 | 231 | #define GPUshared() __shared__ |
|
0 commit comments