Skip to content

Commit e01c675

Browse files
committed
GPU:Remove OpenCL 1.2, now that OpenCL 2 supports all its functionality
1 parent 4a3f261 commit e01c675

37 files changed

+39
-463
lines changed

GPU/Common/GPUCommonConstants.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717

1818
#include "GPUCommonDef.h"
1919

20-
#if !defined(__OPENCL1__)
2120
namespace GPUCA_NAMESPACE::gpu::gpu_common_constants
2221
{
23-
static CONSTEXPR const float kCLight = 0.000299792458f; // TODO: Duplicate of MathConstants, fix this when OpenCL1 is removed
22+
static CONSTEXPR const float kCLight = 0.000299792458f; // TODO: Duplicate of MathConstants, fix this now that we use only OpenCL CPP
2423
}
25-
#endif
2624

2725
#endif

GPU/Common/GPUCommonDef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//Some GPU configuration settings, must be included first
3131
#include "GPUCommonDefSettings.h"
3232

33-
#if !defined(__OPENCL1__) && (!(defined(__CINT__) || defined(__ROOTCINT__)) || defined(__CLING__)) && defined(__cplusplus) && __cplusplus >= 201103L
33+
#if (!(defined(__CINT__) || defined(__ROOTCINT__)) || defined(__CLING__)) && defined(__cplusplus) && __cplusplus >= 201103L
3434
#define GPUCA_NOCOMPAT // C++11 + No old ROOT5 + No old OpenCL
3535
#ifndef __OPENCL__
3636
#define GPUCA_NOCOMPAT_ALLOPENCL // + No OpenCL at all
@@ -82,7 +82,7 @@
8282
#define GPUCA_NAMESPACE o2
8383
#endif
8484

85-
#if (defined(__CUDACC__) && defined(GPUCA_CUDA_NO_CONSTANT_MEMORY)) || (defined(__HIPCC__) && defined(GPUCA_HIP_NO_CONSTANT_MEMORY)) || (defined(__OPENCL1__) && defined(GPUCA_OPENCL_NO_CONSTANT_MEMORY)) || (defined(__OPENCLCPP__) && defined(GPUCA_OPENCLCPP_NO_CONSTANT_MEMORY))
85+
#if (defined(__CUDACC__) && defined(GPUCA_CUDA_NO_CONSTANT_MEMORY)) || (defined(__HIPCC__) && defined(GPUCA_HIP_NO_CONSTANT_MEMORY)) || (defined(__OPENCLCPP__) && defined(GPUCA_OPENCLCPP_NO_CONSTANT_MEMORY))
8686
#define GPUCA_NO_CONSTANT_MEMORY
8787
#elif defined(__CUDACC__) || defined(__HIPCC__)
8888
#define GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM

GPU/Common/GPUCommonDefSettings.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
//#define GPUCA_CUDA_NO_CONSTANT_MEMORY // Do not use constant memory for CUDA
2828
//#define GPUCA_HIP_NO_CONSTANT_MEMORY // Do not use constant memory for HIP
29-
//#define GPUCA_OPENCL_NO_CONSTANT_MEMORY // Do not use constant memory for OpenCL 1.2
3029
#define GPUCA_OPENCLCPP_NO_CONSTANT_MEMORY // Do not use constant memory for OpenCL C++ - MANDATORY as OpenCL cannot cast between __constant and __generic yet!
3130

3231
// clang-format on

GPU/Common/GPUCommonMath.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@
3131
#include <cstdint>
3232
#endif
3333

34-
#if !defined(__OPENCL1__)
3534
namespace GPUCA_NAMESPACE
3635
{
3736
namespace gpu
3837
{
39-
#endif
4038

4139
class GPUCommonMath
4240
{
@@ -289,7 +287,7 @@ GPUhdi() void GPUCommonMath::SinCosd(double x, double& s, double& c)
289287

290288
GPUdi() uint32_t GPUCommonMath::Clz(uint32_t x)
291289
{
292-
#if (defined(__GNUC__) || defined(__clang__) || defined(__CUDACC__) || defined(__HIPCC__)) && !defined(__OPENCL1__)
290+
#if (defined(__GNUC__) || defined(__clang__) || defined(__CUDACC__) || defined(__HIPCC__))
293291
return x == 0 ? 32 : CHOICE(__builtin_clz(x), __clz(x), __builtin_clz(x)); // use builtin if available
294292
#else
295293
for (int32_t i = 31; i >= 0; i--) {
@@ -303,7 +301,7 @@ GPUdi() uint32_t GPUCommonMath::Clz(uint32_t x)
303301

304302
GPUdi() uint32_t GPUCommonMath::Popcount(uint32_t x)
305303
{
306-
#if (defined(__GNUC__) || defined(__clang__) || defined(__CUDACC__) || defined(__HIPCC__)) && (!defined(__OPENCL__) /* !defined(__OPENCL1__)*/) // TODO: exclude only OPENCLC (not CPP) when reported SPIR-V bug is fixed
304+
#if (defined(__GNUC__) || defined(__clang__) || defined(__CUDACC__) || defined(__HIPCC__)) && !defined(__OPENCL__) // TODO: remove OPENCL when reported SPIR-V bug is fixed
307305
// use builtin if available
308306
return CHOICE(__builtin_popcount(x), __popc(x), __builtin_popcount(x));
309307
#else
@@ -563,9 +561,7 @@ GPUdii() void GPUCommonMath::AtomicMinInternal(GPUglobalref() GPUgeneric() GPUAt
563561

564562
#undef CHOICE
565563

566-
#if !defined(__OPENCL1__)
567-
}
568-
}
569-
#endif
564+
} // namespace gpu
565+
} // namespace GPUCA_NAMESPACE
570566

571567
#endif // GPUCOMMONMATH_H

GPU/Common/GPUCommonTypeTraits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#ifndef GPUCA_GPUCODE_COMPILEKERNELS
2222
#include <type_traits>
2323
#endif
24-
#elif !defined(__OPENCL1__)
24+
#else
2525
// We just reimplement some type traits in std for the GPU
2626
namespace std
2727
{

GPU/GPUTracking/Base/GPUConstantMem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "GPUDataTypes.h"
2121
#include "GPUErrors.h"
2222

23-
// Dummies for stuff not supported in legacy code (ROOT 5 / OPENCL1.2)
23+
// Dummies for stuff not supported in legacy code (ROOT 5)
2424
#if defined(GPUCA_NOCOMPAT_ALLCINT)
2525
#include "GPUTPCGMMerger.h"
2626
#else

GPU/GPUTracking/Base/GPUParam.inc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
#include "GPUParam.h"
1919
#include "GPUTPCGMMergedTrackHit.h"
20-
#if !defined(__OPENCL1__)
2120
#include "GPUTPCClusterOccupancyMap.h"
22-
#endif
2321

2422
namespace GPUCA_NAMESPACE
2523
{
@@ -228,15 +226,11 @@ GPUdi() void MEM_LG(GPUParam)::UpdateClusterError2ByState(int16_t clusterState,
228226
MEM_CLASS_PRE()
229227
GPUdi() float MEM_LG(GPUParam)::GetUnscaledMult(float time) const
230228
{
231-
#if !defined(__OPENCL1__)
232229
if (!occupancyMap) {
233230
return 0.f;
234231
}
235232
const uint32_t bin = CAMath::Max(0.f, time / rec.tpc.occupancyMapTimeBins);
236233
return occupancyMap[bin];
237-
#else
238-
return 0.f;
239-
#endif
240234
}
241235

242236
MEM_CLASS_PRE()

GPU/GPUTracking/Base/GPUReconstructionAvailableBackends.template.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@
1414

1515
#cmakedefine CUDA_ENABLED
1616
#cmakedefine HIP_ENABLED
17-
#cmakedefine OPENCL1_ENABLED
1817
#cmakedefine OPENCL2_ENABLED

GPU/GPUTracking/Base/GPUReconstructionKernelList.template.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
// No header protection, this may be used multiple times
1616
#include "GPUReconstructionKernelMacros.h"
1717

18-
#if !defined(GPUCA_OPENCL1) && (!defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE))
19-
#define GPUCA_KRNL_NOOCL1
18+
#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE)
19+
#define GPUCA_KRNL_NOALIROOT
2020
#endif
2121

2222
// clang-format off
2323
$<JOIN:$<TARGET_PROPERTY:O2_GPU_KERNELS,O2_GPU_KERNELS>,>
2424
// clang-format on
2525

26-
#ifdef GPUCA_KRNL_NOOCL1
27-
#undef GPUCA_KRNL_NOOCL1
26+
#ifdef GPUCA_KRNL_NOALIROOT
27+
#undef GPUCA_KRNL_NOALIROOT
2828
#endif

GPU/GPUTracking/Base/GPUReconstructionLibrary.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ std::shared_ptr<GPUReconstruction::LibraryLoader>* GPUReconstruction::GetLibrary
101101
} else if (type == DeviceType::HIP) {
102102
#ifdef HIP_ENABLED
103103
return &sLibHIP;
104-
#endif
105-
} else if (type == DeviceType::OCL) {
106-
#ifdef OPENCL1_ENABLED
107-
return &sLibOCL;
108104
#endif
109105
} else if (type == DeviceType::OCL2) {
110106
#ifdef OPENCL2_ENABLED

0 commit comments

Comments
 (0)