Skip to content

Commit 255597c

Browse files
committed
GPU: Fix onefile compile mode after all the refactoring
1 parent 52c2328 commit 255597c

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

GPU/GPUTracking/Base/GPUReconstructionKernelMacros.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,6 @@
6262
}
6363
#endif
6464

65-
// GPU Host wrappers for kernel
66-
#define GPUCA_KRNL_HOST(x_class, ...) \
67-
GPUCA_KRNLGPU(x_class, __VA_ARGS__) \
68-
template <> class GPUCA_M_CAT(GPUReconstruction, GPUCA_GPUTYPE)::backendInternal<GPUCA_M_KRNL_TEMPLATE(x_class)> { \
69-
public: \
70-
template <typename T, typename... Args> \
71-
static inline void runKernelBackendMacro(const krnlSetupTime& _xyz, T* me, const Args&... args) \
72-
{ \
73-
auto& x = _xyz.x; \
74-
auto& y = _xyz.y; \
75-
GPUCA_KRNL_CALL(x_class, __VA_ARGS__) \
76-
} \
77-
};
78-
7965
#endif // GPUCA_GPUCODE
8066

8167
#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__)

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class GPUReconstructionCUDA : public GPUReconstructionProcessing::KernelInterfac
4848
void runKernelBackend(const krnlSetupTime& _xyz, const Args&... args);
4949
template <class T, int32_t I = 0, typename... Args>
5050
void runKernelBackendTimed(const krnlSetupTime& _xyz, const Args&... args);
51+
template <class T, int32_t I>
52+
struct kernelBackendMacro;
5153

5254
template <class T, class S>
5355
friend GPUh() void GPUCommonAlgorithm::sortOnDevice(auto* rec, int32_t stream, T* begin, size_t N, const S& comp);

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAKernels.cu

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ inline void GPUReconstructionCUDA::runKernelBackendTimed(const krnlSetupTime& _x
3535
{
3636
#if !defined(GPUCA_KERNEL_COMPILE_MODE) || GPUCA_KERNEL_COMPILE_MODE != 1
3737
if (!GetProcessingSettings().rtc.enable) {
38-
backendInternal<T, I>::runKernelBackendMacro(_xyz, this, args...);
38+
kernelBackendMacro<T, I>::run(_xyz, this, args...);
3939
} else
4040
#endif
4141
{
@@ -82,9 +82,6 @@ inline void GPUReconstructionCUDA::runKernelBackend(const krnlSetupTime& _xyz, c
8282
#define GPUCA_KRNL_DEFONLY // COMPILE_MODE = rdc
8383
#endif
8484

85-
#define GPUCA_KRNL(x_class, x_attributes, x_arguments, x_forward, x_types, ...) \
86-
GPUCA_KRNL_HOST(x_class, x_attributes, x_arguments, x_forward, x_types, __VA_ARGS__)
87-
8885
#ifndef __HIPCC__ // CUDA version
8986
#define GPUCA_KRNL_CALL(x_class, ...) \
9087
GPUCA_M_CAT(krnl_, GPUCA_M_KRNL_NAME(x_class))<<<x.nBlocks, x.nThreads, 0, me->mInternals->Streams[x.stream]>>>(GPUCA_CONSMEM_CALL y.index, args...);
@@ -95,6 +92,18 @@ inline void GPUReconstructionCUDA::runKernelBackend(const krnlSetupTime& _xyz, c
9592
hipLaunchKernelGGL(HIP_KERNEL_NAME(GPUCA_M_CAT(krnl_, GPUCA_M_KRNL_NAME(x_class))), dim3(x.nBlocks), dim3(x.nThreads), 0, me->mInternals->Streams[x.stream], GPUCA_CONSMEM_CALL y.index, args...);
9693
#endif // __HIPCC__
9794

95+
#define GPUCA_KRNL(x_class, x_attributes, x_arguments, x_forward, x_types, ...) \
96+
GPUCA_KRNLGPU(x_class, x_attributes, x_arguments, x_forward, x_types, __VA_ARGS__) \
97+
template <> struct GPUReconstructionCUDA::kernelBackendMacro<GPUCA_M_KRNL_TEMPLATE(x_class)> { \
98+
template <typename... Args> \
99+
static inline void run(const GPUReconstructionProcessing::krnlSetupTime& _xyz, auto* me, const Args&... args) \
100+
{ \
101+
auto& x = _xyz.x; \
102+
auto& y = _xyz.y; \
103+
GPUCA_KRNL_CALL(x_class, x_attributes, x_arguments, x_forward, x_types, __VA_ARGS__) \
104+
} \
105+
};
106+
98107
#include "GPUReconstructionKernelList.h"
99108
#undef GPUCA_KRNL
100109
#endif // ---------- COMPILE_MODE = onefile | rdc ----------

0 commit comments

Comments
 (0)