Skip to content

Commit c758e98

Browse files
committed
GPU OpenCL: Rename OPENCLCPP macros to OPENCL, since OPENCLC was removed
1 parent f9e0b93 commit c758e98

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

GPU/Common/GPUCommonDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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(__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(__OPENCL__) && defined(GPUCA_OPENCL_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/GPUCommonDefAPI.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@
9595
#define GPUprivate() __private
9696
#define GPUgeneric() __generic
9797
#define GPUconstexprref() GPUconstexpr()
98-
#if defined(__OPENCLCPP__) && !defined(__clang__)
98+
#if defined(__OPENCL__) && !defined(__clang__)
9999
#define GPUbarrier() work_group_barrier(mem_fence::global | mem_fence::local);
100100
#define GPUbarrierWarp()
101101
#define GPUAtomic(type) atomic<type>
102102
static_assert(sizeof(atomic<uint32_t>) == sizeof(uint32_t), "Invalid size of atomic type");
103103
#else
104104
#define GPUbarrier() barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE)
105105
#define GPUbarrierWarp()
106-
#if defined(__OPENCLCPP__) && defined(GPUCA_OPENCL_CPP_CLANG_C11_ATOMICS)
106+
#if defined(__OPENCL__) && defined(GPUCA_OPENCL_CLANG_C11_ATOMICS)
107107
namespace GPUCA_NAMESPACE { namespace gpu {
108108
template <class T> struct oclAtomic;
109109
template <> struct oclAtomic<uint32_t> {typedef atomic_uint t;};
@@ -114,14 +114,14 @@
114114
#define GPUAtomic(type) volatile type
115115
#endif
116116
#endif
117-
#if !defined(__OPENCLCPP__) // Other special defines for OpenCL 1
117+
#if !defined(__OPENCL__) // Other special defines for OpenCL 1
118118
#define GPUCA_USE_TEMPLATE_ADDRESS_SPACES // TODO: check if we can make this (partially, where it is already implemented) compatible with OpenCL CPP
119119
#define GPUsharedref() GPUshared()
120120
#define GPUglobalref() GPUglobal()
121121
#undef GPUgeneric
122122
#define GPUgeneric()
123123
#endif
124-
#if (!defined(__OPENCLCPP__) || !defined(GPUCA_NO_CONSTANT_MEMORY))
124+
#if (!defined(__OPENCL__) || !defined(GPUCA_NO_CONSTANT_MEMORY))
125125
#define GPUconstantref() GPUconstant()
126126
#endif
127127
#elif defined(__HIPCC__) //Defines for HIP

GPU/Common/GPUCommonDefSettings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
#error Please include GPUCommonDef.h!
2323
#endif
2424

25-
//#define GPUCA_OPENCL_CPP_CLANG_C11_ATOMICS // Use C11 atomic instead of old style atomics for OpenCL C++ in clang (OpenCL 2.2 C++ will use C++11 atomics irrespectively)
25+
//#define GPUCA_OPENCL_CLANG_C11_ATOMICS // Use C11 atomic instead of old style atomics for OpenCL C++ in clang (OpenCL 2.2 C++ will use C++11 atomics irrespectively)
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_OPENCLCPP_NO_CONSTANT_MEMORY // Do not use constant memory for OpenCL C++ - MANDATORY as OpenCL cannot cast between __constant and __generic yet!
29+
#define GPUCA_OPENCL_NO_CONSTANT_MEMORY // Do not use constant memory for OpenCL C++ - MANDATORY as OpenCL cannot cast between __constant and __generic yet!
3030

3131
// clang-format on
3232

GPU/Common/GPUCommonMath.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ GPUhdi() int32_t GPUCommonMath::Abs<int32_t>(int32_t x)
437437

438438
GPUhdi() float GPUCommonMath::Copysign(float x, float y)
439439
{
440-
#if defined(__OPENCLCPP__)
440+
#if defined(__OPENCL__)
441441
return copysign(x, y);
442442
#elif defined(GPUCA_GPUCODE) && !defined(__OPENCL__)
443443
return copysignf(x, y);
@@ -452,7 +452,7 @@ GPUhdi() float GPUCommonMath::Copysign(float x, float y)
452452
template <class S, class T>
453453
GPUdi() uint32_t GPUCommonMath::AtomicExchInternal(S* addr, T val)
454454
{
455-
#if defined(GPUCA_GPUCODE) && defined(__OPENCLCPP__) && (!defined(__clang__) || defined(GPUCA_OPENCL_CPP_CLANG_C11_ATOMICS))
455+
#if defined(GPUCA_GPUCODE) && defined(__OPENCL__) && (!defined(__clang__) || defined(GPUCA_OPENCL_CLANG_C11_ATOMICS))
456456
return ::atomic_exchange(addr, val);
457457
#elif defined(GPUCA_GPUCODE) && defined(__OPENCL__)
458458
return ::atomic_xchg(addr, val);
@@ -470,7 +470,7 @@ GPUdi() uint32_t GPUCommonMath::AtomicExchInternal(S* addr, T val)
470470
template <class S, class T>
471471
GPUdi() bool GPUCommonMath::AtomicCASInternal(S* addr, T cmp, T val)
472472
{
473-
#if defined(GPUCA_GPUCODE) && defined(__OPENCLCPP__) && (!defined(__clang__) || defined(GPUCA_OPENCL_CPP_CLANG_C11_ATOMICS))
473+
#if defined(GPUCA_GPUCODE) && defined(__OPENCL__) && (!defined(__clang__) || defined(GPUCA_OPENCL_CLANG_C11_ATOMICS))
474474
return ::atomic_compare_exchange(addr, cmp, val) == cmp;
475475
#elif defined(GPUCA_GPUCODE) && defined(__OPENCL__)
476476
return ::atomic_cmpxchg(addr, cmp, val) == cmp;
@@ -486,7 +486,7 @@ GPUdi() bool GPUCommonMath::AtomicCASInternal(S* addr, T cmp, T val)
486486
template <class S, class T>
487487
GPUdi() uint32_t GPUCommonMath::AtomicAddInternal(S* addr, T val)
488488
{
489-
#if defined(GPUCA_GPUCODE) && defined(__OPENCLCPP__) && (!defined(__clang__) || defined(GPUCA_OPENCL_CPP_CLANG_C11_ATOMICS))
489+
#if defined(GPUCA_GPUCODE) && defined(__OPENCL__) && (!defined(__clang__) || defined(GPUCA_OPENCL_CLANG_C11_ATOMICS))
490490
return ::atomic_fetch_add(addr, val);
491491
#elif defined(GPUCA_GPUCODE) && defined(__OPENCL__)
492492
return ::atomic_add(addr, val);
@@ -502,7 +502,7 @@ GPUdi() uint32_t GPUCommonMath::AtomicAddInternal(S* addr, T val)
502502
template <class S, class T>
503503
GPUdi() void GPUCommonMath::AtomicMaxInternal(S* addr, T val)
504504
{
505-
#if defined(GPUCA_GPUCODE) && defined(__OPENCLCPP__) && (!defined(__clang__) || defined(GPUCA_OPENCL_CPP_CLANG_C11_ATOMICS))
505+
#if defined(GPUCA_GPUCODE) && defined(__OPENCL__) && (!defined(__clang__) || defined(GPUCA_OPENCL_CLANG_C11_ATOMICS))
506506
::atomic_fetch_max(addr, val);
507507
#elif defined(GPUCA_GPUCODE) && defined(__OPENCL__)
508508
::atomic_max(addr, val);
@@ -518,7 +518,7 @@ GPUdi() void GPUCommonMath::AtomicMaxInternal(S* addr, T val)
518518
template <class S, class T>
519519
GPUdi() void GPUCommonMath::AtomicMinInternal(S* addr, T val)
520520
{
521-
#if defined(GPUCA_GPUCODE) && defined(__OPENCLCPP__) && (!defined(__clang__) || defined(GPUCA_OPENCL_CPP_CLANG_C11_ATOMICS))
521+
#if defined(GPUCA_GPUCODE) && defined(__OPENCL__) && (!defined(__clang__) || defined(GPUCA_OPENCL_CLANG_C11_ATOMICS))
522522
::atomic_fetch_min(addr, val);
523523
#elif defined(GPUCA_GPUCODE) && defined(__OPENCL__)
524524
::atomic_min(addr, val);

GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
// clang-format off
1616
#define __OPENCL__
1717
#if defined(__cplusplus) && __cplusplus >= 201703L
18-
#define __OPENCLCPP__
18+
#define __OPENCL__
1919
#endif
2020
#define GPUCA_GPUTYPE_OPENCL
2121

22-
#ifdef __OPENCLCPP__
23-
#ifdef GPUCA_OPENCLCPP_NO_CONSTANT_MEMORY
22+
#ifdef __OPENCL__
23+
#ifdef GPUCA_OPENCL_NO_CONSTANT_MEMORY
2424
#define GPUCA_NO_CONSTANT_MEMORY
2525
#endif
2626
#pragma OPENCL EXTENSION cl_khr_fp64 : enable // Allow double precision variables

GPU/GPUTracking/Definitions/GPUDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// Macros for masking ptrs in OpenCL kernel calls as uint64_t (The API only allows us to pass buffer objects)
2525
#ifdef __OPENCL__
2626
#define GPUPtr1(a, b) uint64_t b
27-
#ifdef __OPENCLCPP__
27+
#ifdef __OPENCL__
2828
#define GPUPtr2(a, b) ((__generic a) (a) b)
2929
#else
3030
#define GPUPtr2(a, b) ((__global a) (a) b)

0 commit comments

Comments
 (0)