3131#include < cstdint>
3232#endif
3333
34- #if !defined(__OPENCL__) || defined(__OPENCLCPP__ )
34+ #if !defined(__OPENCL1__ )
3535namespace GPUCA_NAMESPACE
3636{
3737namespace gpu
@@ -220,7 +220,7 @@ GPUdi() uint32_t GPUCommonMath::Float2UIntReint(const float& x)
220220{
221221#if defined(GPUCA_GPUCODE_DEVICE) && (defined(__CUDACC__) || defined(__HIPCC__))
222222 return __float_as_uint (x);
223- #elif defined(GPUCA_GPUCODE_DEVICE) && ( defined(__OPENCL__) || defined(__OPENCLCPP__) )
223+ #elif defined(GPUCA_GPUCODE_DEVICE) && defined(__OPENCL__)
224224 return as_uint (x);
225225#else
226226 return reinterpret_cast <const uint32_t &>(x);
@@ -289,7 +289,7 @@ GPUhdi() void GPUCommonMath::SinCosd(double x, double& s, double& c)
289289
290290GPUdi () uint32_t GPUCommonMath::Clz (uint32_t x)
291291{
292- #if (defined(__GNUC__) || defined(__clang__) || defined(__CUDACC__) || defined(__HIPCC__)) && ( !defined(__OPENCL__) || defined(__OPENCLCPP__) )
292+ #if (defined(__GNUC__) || defined(__clang__) || defined(__CUDACC__) || defined(__HIPCC__)) && !defined(__OPENCL1__ )
293293 return x == 0 ? 32 : CHOICE (__builtin_clz (x), __clz (x), __builtin_clz (x)); // use builtin if available
294294#else
295295 for (int32_t i = 31 ; i >= 0 ; i--) {
@@ -303,7 +303,7 @@ GPUdi() uint32_t GPUCommonMath::Clz(uint32_t x)
303303
304304GPUdi () uint32_t GPUCommonMath::Popcount (uint32_t x)
305305{
306- #if (defined(__GNUC__) || defined(__clang__) || defined(__CUDACC__) || defined(__HIPCC__)) && (!defined(__OPENCL__) /* || defined(__OPENCLCPP__ )*/ ) // TODO: remove OPENCLCPP workaround when reported SPIR-V bug is fixed
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
307307 // use builtin if available
308308 return CHOICE (__builtin_popcount (x), __popc (x), __builtin_popcount (x));
309309#else
@@ -563,7 +563,7 @@ GPUdii() void GPUCommonMath::AtomicMinInternal(GPUglobalref() GPUgeneric() GPUAt
563563
564564#undef CHOICE
565565
566- #if !defined(__OPENCL__) || defined(__OPENCLCPP__ )
566+ #if !defined(__OPENCL1__ )
567567}
568568}
569569#endif
0 commit comments