|
27 | 27 | #endif |
28 | 28 | #include "GPUDefParametersConstants.h" |
29 | 29 |
|
30 | | -#ifdef GPUCA_GPUCODE |
31 | | - #define GPUCA_GET_THREAD_COUNT(...) GPUCA_M_FIRST(__VA_ARGS__) |
| 30 | +namespace o2::gpu |
| 31 | +{ |
| 32 | +#if defined(GPUCA_GPUCODE) |
| 33 | + GPUhdi() static constexpr uint32_t GPUCA_GET_THREAD_COUNT(uint32_t val, ...) { return val; } |
| 34 | + GPUhdi() static constexpr uint32_t GPUCA_GET_WARP_COUNT(uint32_t val, ...) { return val / GPUCA_WARP_SIZE; } |
32 | 35 | #else |
33 | | - #define GPUCA_GET_THREAD_COUNT(...) 1 // On the host, a thread is a block, and we run 1 "device thread" per block. |
| 36 | + static constexpr uint32_t GPUCA_WARP_SIZE = 1; // On the host, a thread is a block is a warp, and we run 1 "device thread" per block. |
| 37 | + #define GPUCA_GET_THREAD_COUNT(...) 1 // This must be a define not a constexpr function |
| 38 | + #define GPUCA_GET_WARP_COUNT(...) 1 // since launch bound constants are not defined in host-code, and must evaluate to 1! |
34 | 39 | #endif |
35 | 40 |
|
36 | | -#define GPUCA_GET_WARP_COUNT(...) (GPUCA_GET_THREAD_COUNT(__VA_ARGS__) / GPUCA_WARP_SIZE) |
37 | | - |
38 | 41 | #define GPUCA_MERGER_INTERPOLATION_ERROR_TYPE_A GPUCA_DETERMINISTIC_CODE(float, GPUCA_MERGER_INTERPOLATION_ERROR_TYPE) |
39 | 42 | #define GPUCA_DEDX_STORAGE_TYPE_A GPUCA_DETERMINISTIC_CODE(float, GPUCA_DEDX_STORAGE_TYPE) |
40 | 43 |
|
|
46 | 49 | #if defined(GPUCA_GPUCODE) |
47 | 50 | static_assert(GPUCA_MAXN >= GPUCA_NEIGHBOURS_FINDER_MAX_NNEIGHUP, "Invalid GPUCA_NEIGHBOURS_FINDER_MAX_NNEIGHUP"); |
48 | 51 | static_assert(GPUCA_ROW_COUNT >= GPUCA_TRACKLET_SELECTOR_HITS_REG_SIZE, "Invalid GPUCA_TRACKLET_SELECTOR_HITS_REG_SIZE"); |
49 | | - static_assert(GPUCA_M_FIRST(GPUCA_LB_GPUTPCCompressionKernels_step1unattached) * 2 <= GPUCA_TPC_COMP_CHUNK_SIZE, "Invalid GPUCA_TPC_COMP_CHUNK_SIZE"); |
| 52 | + static_assert(GPUCA_GET_THREAD_COUNT(GPUCA_LB_GPUTPCCompressionKernels_step1unattached) * 2 <= GPUCA_TPC_COMP_CHUNK_SIZE, "Invalid GPUCA_TPC_COMP_CHUNK_SIZE"); |
50 | 53 | #endif |
51 | 54 |
|
52 | 55 | // Derived parameters |
53 | 56 | #ifdef GPUCA_USE_TEXTURES |
54 | 57 | #define GPUCA_TEXTURE_FETCH_CONSTRUCTOR // Fetch data through texture cache |
55 | 58 | #endif |
56 | 59 |
|
| 60 | +} // namespace o2::gpu |
| 61 | + |
57 | 62 | // clang-format on |
58 | 63 | #endif // GPUDEFPARAMETERSWRAPPER_H |
0 commit comments