Skip to content

Commit 043fdb0

Browse files
committed
GPU: Get rid of GPUCA_RTC_LB_..., use only GPUCA_LB_...
1 parent 176e79b commit 043fdb0

File tree

7 files changed

+29
-31
lines changed

7 files changed

+29
-31
lines changed

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ class GPUReconstructionCUDABackend : public GPUReconstructionDeviceBase
4545
template <class T, int32_t I = 0, typename... Args>
4646
void runKernelBackendInternal(const krnlSetupTime& _xyz, const Args&... args);
4747

48-
void getRTCKernelCalls(std::vector<std::string>& kernels);
49-
5048
template <class T, class S>
5149
friend GPUh() void GPUCommonAlgorithm::sortOnDevice(auto* rec, int32_t stream, T* begin, size_t N, const S& comp);
5250
GPUReconstructionCUDAInternals* mInternals;
@@ -91,6 +89,7 @@ class GPUReconstructionCUDA : public GPUReconstructionKernels<GPUReconstructionC
9189

9290
private:
9391
int32_t genRTC(std::string& filename, uint32_t& nCompile);
92+
void getRTCKernelCalls(std::vector<std::string>& kernels);
9493
void genAndLoadRTC();
9594
void loadKernelModules(bool perKernel);
9695
const char *mRtcSrcExtension = ".src", *mRtcBinExtension = ".o";

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,3 +272,13 @@ int32_t GPUReconstructionCUDA::genRTC(std::string& filename, uint32_t& nCompile)
272272

273273
return 0;
274274
}
275+
276+
void GPUReconstructionCUDA::getRTCKernelCalls(std::vector<std::string>& kernels)
277+
{
278+
#undef GPUCA_KRNL_LB
279+
#define GPUCA_KRNL(...) kernels.emplace_back(GPUCA_M_STR(GPUCA_KRNLGPU(__VA_ARGS__)));
280+
#define GPUCA_KRNL_LB(x_class, x_attributes, ...) GPUCA_KRNL(x_class, (REG, (GPUCA_M_CAT(GPUCA_LB_, GPUCA_M_KRNL_NAME(x_class))), GPUCA_M_STRIP(x_attributes)), __VA_ARGS__)
281+
#include "GPUReconstructionKernelList.h"
282+
#undef GPUCA_KRNL
283+
#undef GPUCA_KRNL_LB
284+
}

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAIncludesSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
/// \file GPUReconstructionCUDAIncludesSystem.h
1313
/// \author David Rohr
1414

15-
#ifndef O2_GPU_GPURECONSTRUCTIONCUDAINCLUDES_H
16-
#define O2_GPU_GPURECONSTRUCTIONCUDAINCLUDES_H
15+
#ifndef O2_GPU_GPURECONSTRUCTIONCUDAINCLUDESSYSTEM_H
16+
#define O2_GPU_GPURECONSTRUCTIONCUDAINCLUDESSYSTEM_H
1717

1818
#include <cstdint>
1919
#include <type_traits>
@@ -32,4 +32,4 @@
3232
#include <sm_20_atomic_functions.h>
3333
#include <cuda_fp16.h>
3434

35-
#endif
35+
#endif // O2_GPU_GPURECONSTRUCTIONCUDAINCLUDESSYSTEM_H

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAKernels.cu

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,3 @@ static GPUReconstructionDeviceBase::deviceConstantMemRegistration registerConstS
118118
return retVal;
119119
});
120120
#endif
121-
122-
void GPUReconstructionCUDABackend::getRTCKernelCalls(std::vector<std::string>& kernels)
123-
{
124-
#undef GPUCA_KRNL_LB
125-
#undef __launch_bounds__
126-
#define GPUCA_KRNL(...) kernels.emplace_back(GPUCA_M_STR(GPUCA_KRNLGPU(__VA_ARGS__)));
127-
#define GPUCA_KRNL_LB(x_class, x_attributes, ...) GPUCA_KRNL(x_class, (REG, (GPUCA_M_CAT(GPUCA_RTC_LB_, GPUCA_M_KRNL_NAME(x_class))), GPUCA_M_STRIP(x_attributes)), __VA_ARGS__)
128-
#include "GPUReconstructionKernelList.h"
129-
#undef GPUCA_KRNL
130-
#undef GPUCA_KRNL_LB
131-
}

GPU/GPUTracking/Base/hip/GPUReconstructionHIPIncludesSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
/// \file GPUReconstructionHIPIncludesSystem.h
1313
/// \author David Rohr
1414

15-
#ifndef O2_GPU_RECONSTRUCTIONHIPINCLUDES_H
16-
#define O2_GPU_RECONSTRUCTIONHIPINCLUDES_H
15+
#ifndef O2_GPU_RECONSTRUCTIONHIPINCLUDESSYSTEM_H
16+
#define O2_GPU_RECONSTRUCTIONHIPINCLUDESSYSTEM_H
1717

1818
#include <hip/hip_runtime.h>
1919
#include <hip/hip_ext.h>
@@ -25,4 +25,4 @@
2525
#include <thrust/device_ptr.h>
2626
#pragma GCC diagnostic pop
2727

28-
#endif
28+
#endif // O2_GPU_RECONSTRUCTIONHIPINCLUDESSYSTEM_H

GPU/GPUTracking/Definitions/GPUDefParametersLoad.template.inc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ static GPUDefParameters GPUDefParametersLoad()
3737
};
3838
}
3939

40-
#define GPUCA_EXPORT_KERNEL(name) \
41-
if (par.par_LB_maxThreads[i] > 0) { \
42-
o << "#define GPUCA_" << (forRTC ? "RTC_" : "") << "LB_" << GPUCA_M_STR(name) " " << par.par_LB_maxThreads[i]; \
43-
if (par.par_LB_minBlocks[i] > 0) { \
44-
o << ", " << par.par_LB_minBlocks[i]; \
45-
} \
46-
if (!forRTC && par.par_LB_forceBlocks[i] > 0) { \
47-
o << ", " << par.par_LB_forceBlocks[i]; \
48-
} \
49-
o << "\n"; \
50-
} \
40+
#define GPUCA_EXPORT_KERNEL(name) \
41+
if (par.par_LB_maxThreads[i] > 0) { \
42+
o << "#define GPUCA_LB_" << GPUCA_M_STR(name) " " << par.par_LB_maxThreads[i]; \
43+
if (par.par_LB_minBlocks[i] > 0) { \
44+
o << ", " << par.par_LB_minBlocks[i]; \
45+
} \
46+
if (!forRTC && par.par_LB_forceBlocks[i] > 0) { \
47+
o << ", " << par.par_LB_forceBlocks[i]; \
48+
} \
49+
o << "\n"; \
50+
} \
5151
i++;
5252

5353
static std::string GPUDefParametersExport(const GPUDefParameters& par, bool forRTC)

GPU/GPUTracking/Definitions/GPUDefParametersWrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "GPUCommonDef.h"
2323
#include "GPUDefMacros.h"
2424

25-
#ifndef GPUCA_GPUCODE_GENRTC
25+
#if defined(GPUCA_GPUCODE) && !defined(GPUCA_GPUCODE_GENRTC)
2626
#include "GPUDefParametersDefaults.h"
2727
#endif
2828
#include "GPUDefParametersConstants.h"

0 commit comments

Comments
 (0)