Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
d8ffc84
GPU: Drop obvious comments
davidrohr Nov 30, 2026
01f1a8e
Propagator: Workaround for OpenCL with Clang
davidrohr Nov 30, 2026
aa6577c
GPU: Use double in DETERMINISTIC_MODE on OpenCL
davidrohr Nov 30, 2026
008dcc0
GPU: Fix segfault in case of unclean OpenCL exit
davidrohr Nov 30, 2026
b445ab9
GPU OpenCL: forward math flags to SPIR-V to binary compilation at run…
davidrohr Nov 30, 2026
e827047
GPU OpenCL: Disable FMA in DETERMINISTIC_MODE
davidrohr Nov 30, 2026
5a3d4d0
GPU OpenCL: Print hit to use POCL debug flag if compilation fails
davidrohr Nov 30, 2026
3f04996
GPU: Fix race while updating occupancy map, must not use temporary va…
davidrohr Nov 30, 2026
bb4720e
GPU: Fix allignment of Merger tmpCounters
davidrohr Nov 30, 2026
7676862
GPU Debug: Add dump for TPC occupancy map
davidrohr Nov 30, 2026
48011ff
GPU: Kill tracks with 0 (or < 10) clusters after rebuld
davidrohr Nov 30, 2026
de44408
GPU OpenCL: Use gather mode 1, the default takes ages to compile
davidrohr Nov 30, 2026
a930d94
GPU: Improve host memory estimation with gather mode 1
davidrohr Nov 30, 2026
eb8bba4
GPU: Fix typo: Invalid gather mode was selected
davidrohr Nov 30, 2026
24d52c7
GPU: Add GPUbarrierWarpAlive(), for cases where only performance matt…
davidrohr Nov 30, 2026
74f74dd
GPU: Add missing warp synchronization to gather kernel
davidrohr Nov 30, 2026
bd55c13
GPU: Finalize slave chains (e.g. write debug output)
davidrohr Nov 30, 2026
336e577
GPU OpenCL: Implement missing dummy functions for memory registration
davidrohr Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Detectors/Base/src/Propagator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ GPUd() bool PropagatorImpl<value_T>::propagateToR(track_T& track, value_type r,
bool clockwise = curv < 0; // q+ in B+ or q- in B- goes clockwise
auto phiLoc = math_utils::detail::asin<double>(track.getSnp());
auto phi0 = phiLoc + track.getAlpha();
o2::math_utils::detail::bringTo02Pi(phi0);
o2::math_utils::bringTo02Pid(phi0); // not detail::bringTo02Pi(): Clang OpenCL C++ mangles the deduced private-reference instantiation like the explicit <double> one, giving invalid IR
for (int i = 0; i < cross.nDCA; i++) {
// track pT direction angle at crossing points:
// == angle of the tangential to track circle at the crossing point X,Y
Expand All @@ -597,7 +597,7 @@ GPUd() bool PropagatorImpl<value_T>::propagateToR(track_T& track, value_type r,
normY = -normY;
}
phiCross[i] = math_utils::detail::atan2<double>(normY, normX);
o2::math_utils::detail::bringTo02Pi(phiCross[i]);
o2::math_utils::bringTo02Pid(phiCross[i]);
dphi[i] = phiCross[i] - phi0;
if (dphi[i] > o2::constants::math::PI) {
dphi[i] -= o2::constants::math::TwoPI;
Expand Down
18 changes: 3 additions & 15 deletions GPU/Common/GPUCommonAlgorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,7 @@ GPUdi() void GPUCommonAlgorithm::swap(T& a, T& b)
}
#endif

// std::partition_point over the indices [first, first + count): the first index for which pred is false, pred being true on a prefix.
// A lower bound of value in a sorted key(i) is pred(i) = key(i) < value, an upper bound pred(i) = !(value < key(i)).
template <class I, class P>
template <class I, class P> // std::partition_point over the indices [first, first + count): the first index for which pred is false, pred being true on a prefix. A lower bound of value in a sorted key(i) is pred(i) = key(i) < value, an upper bound pred(i) = !(value < key(i)).
GPUhdi() I GPUCommonAlgorithm::partitionPoint(I first, I count, const P& pred)
{
while (count > 0) {
Expand Down Expand Up @@ -459,8 +457,6 @@ GPUdi() T warp_shuffle_xor(T v, int32_t laneMask)
#endif
}

// Butterfly all-reduce over groups of Width lanes: every lane gets the result.
// Width is a power of two and must not exceed the hardware warp size.
template <int32_t Width, class T>
GPUdi() T warp_reduce_add(T v)
{
Expand Down Expand Up @@ -501,16 +497,8 @@ GPUdi() T warp_reduce_max(T v)
}

#elif defined(__METAL__)
// MSL has SIMD-group collectives only, so the work-group ones scan within each
// SIMD group and then across the group totals, which go through smem as with
// cub. The thread index is a kernel parameter in MSL, so like smem it is taken
// from the caller's scope. A 1D threadgroup is split into SIMD groups of
// consecutive threads, of GPUCA_WARP_SIZE each. The SIMD scans take 32-bit
// lanes; the narrower types are counts and are widened. Sums are returned
// promoted, as v + 0 would be, since the callers pass !!pred: a bool would
// truncate them to 0 / 1. They only exchange data through smem, so their
// barriers fence threadgroup memory only: a device-memory fence, as
// GPUbarrier() has, costs the stream compaction ~10%.
// MSL has only SIMD-group collectives: work-group scans run per SIMD group (GPUCA_WARP_SIZE consecutive threads, 32-bit lanes, narrower counts widened), then across the group totals via smem; the thread index comes from the caller like smem.
// Sums are returned promoted (callers pass !!pred, a bool would truncate them); barriers fence threadgroup memory only, a device-memory fence as in GPUbarrier() costs the stream compaction ~10%.

template <class T>
GPUdi() auto warp_scan_inclusive_add(T v) -> decltype(+v)
Expand Down
12 changes: 3 additions & 9 deletions GPU/Common/GPUCommonDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@
#define GPUCA_ALIGPUCODE // Part of GPUTracking library but not of interface
#endif

// __METAL__ unconditionally: the MSL generic address space does not span
// `constant`, so a generic member function cannot be called on an object living
// there, and the shared code is generic throughout.
#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)) || defined(__METAL__)
#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)) || defined(__METAL__) // __METAL__ unconditionally: the MSL generic address space does not span `constant`
#define GPUCA_NO_CONSTANT_MEMORY
#elif (defined(__CUDACC__) || defined(__HIPCC__)) && !defined(GPUCA_GPUCODE_HOSTONLY)
#define GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM
Expand All @@ -84,10 +81,7 @@
#endif

#if defined(GPUCA_DETERMINISTIC_MODE) && defined(__METAL__)
// The deterministic paths compute the transcendentals in double (see
// GPUCommonMath::SinCos). The emulated double is bit-exact for + - * / but
// its sin and cos are within 2 ulp of libm, not identical to it, so the
// results could not match the other backends.
// The emulated double on metal is bit-exact for + - * / but its sin and cos are within 2 ulp of libm
#error "GPUCA_DETERMINISTIC_MODE is not supported on Metal"
#endif

Expand All @@ -99,7 +93,7 @@
#endif
#endif

#ifdef GPUCA_GPUCODE // Macros, not functions: the arguments contain code that exists only on the CPU
#ifdef GPUCA_GPUCODE
#define GPUCA_IGNORE_ON_GPU(...)
#else
#define GPUCA_IGNORE_ON_GPU(...) __VA_ARGS__
Expand Down
38 changes: 10 additions & 28 deletions GPU/Common/GPUCommonDefAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#define GPUgeneric() // reference / ptr to generic address space
#define GPUbarrier() // synchronize all GPU threads in block
#define GPUbarrierWarp() // synchronize threads inside warp
#define GPUbarrierWarpAlive() // GPUbarrierWarp() where threads may skip it or have exited (e.g. warp reconvergence in loops), empty where the backend requires all threads
#define GPUAtomic(type) type // atomic variable type
#define GPUsharedref() // reference / ptr to shared memory
#define GPUglobalref() // reference / ptr to global memory
Expand Down Expand Up @@ -100,11 +101,13 @@
#if defined(__OPENCL__) && !defined(__clang__)
#define GPUbarrier() work_group_barrier(mem_fence::global | mem_fence::local)
#define GPUbarrierWarp() sub_group_barrier(mem_fence::global | mem_fence::local)
#define GPUbarrierWarpAlive()
#define GPUAtomic(type) atomic<type>
static_assert(sizeof(atomic<uint32_t>) == sizeof(uint32_t), "Invalid size of atomic type");
#else
#define GPUbarrier() barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE)
#define GPUbarrierWarp() sub_group_barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE)
#define GPUbarrierWarpAlive()
#if defined(__OPENCL__) && defined(GPUCA_OPENCL_CLANG_C11_ATOMICS)
namespace o2 { namespace gpu {
template <class T> struct oclAtomic;
Expand All @@ -126,25 +129,7 @@
#if (!defined(__OPENCL__) || !defined(GPUCA_NO_CONSTANT_MEMORY))
#define GPUconstantref() GPUconstant()
#endif
#elif defined(__METAL__) //Defines for Metal Shading Language
// ADDRESS SPACES. This backend targets MSL 4.1 (macOS 27) and later only --
// see -std=metal4.1 in the CMakeLists, which fails the build on anything
// older rather than miscompiling quietly.
//
// That version is what makes the port tractable: up to MSL 4.0 a member
// function's implicit `this` is `thread`, which is wrong for us, since most
// objects the kernels touch live in `device` memory. Pinning defaulted
// constructors and operators to `device` was the 4.0 workaround, and it made
// the same type unusable in `thread` or `threadgroup`. In 4.1 an unannotated
// `this` is GENERIC and resolves to whichever address space the object is in
// -- the C++ semantics this codebase already assumes -- so GPUdDefault()
// needs nothing at all. The compiler resolves it statically in almost every
// case; it only falls back to a runtime branch where it cannot see through,
// such as argument buffers or dynamic libraries.
//
// The *ref() macros below stay explicit even so. They are already correct
// from the OpenCL port, an explicit annotation is never slower than a generic
// one, and `constant` is not covered by generic pointers at all.
#elif defined(__METAL__) //Defines for Metal Shading Language: ADDRESS SPACES. This backend targets MSL 4.1 (macOS 27) and later only
#define GPUdDefault() // generic `this` (MSL 4.1+)
#define GPUd()
#define GPUhdDefault()
Expand Down Expand Up @@ -173,6 +158,7 @@
#define GPUdouble() float
#define GPUbarrier() threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup)
#define GPUbarrierWarp() simdgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup)
#define GPUbarrierWarpAlive()
#define GPUAtomic(type) type // atomic variable type
#elif defined(__HIPCC__) //Defines for HIP
#define GPUd() __device__
Expand All @@ -196,6 +182,7 @@
#define GPUgeneric()
#define GPUbarrier() __syncthreads()
#define GPUbarrierWarp()
#define GPUbarrierWarpAlive()
#define GPUAtomic(type) type
#elif defined(__CUDACC__) //Defines for CUDA
#ifndef GPUCA_GPUCODE_DEVICE
Expand Down Expand Up @@ -223,6 +210,7 @@
#define GPUgeneric()
#define GPUbarrier() __syncthreads()
#define GPUbarrierWarp() __syncwarp()
#define GPUbarrierWarpAlive() GPUbarrierWarp()
#define GPUAtomic(type) type
#endif

Expand Down Expand Up @@ -271,10 +259,7 @@
#define get_group_id(dim) (blockIdx.x)
#elif defined(__OPENCL__)
// Using OpenCL defaults
#elif defined(__METAL__)
// MSL has no work-item builtins. They arrive as attributes on the entry point,
// named there after the nBlocks / nThreads / iBlock / iThread that Thread()
// already takes, so these resolve both there and in every function below it.
#elif defined(__METAL__) // MSL has no work-item builtins. They arrive as attributes on the entry point, named there after the nBlocks / nThreads / iBlock / iThread that Thread() already takes, so these resolve both there and in every function below it.
#define get_global_id(dim) (iBlock * nThreads + iThread)
#define get_global_size(dim) (nBlocks * nThreads)
#define get_num_groups(dim) (nBlocks)
Expand All @@ -290,9 +275,7 @@
#define get_group_id(dim) iBlock
#endif

// A device function that uses the helpers above but has none of the indices in
// scope needs them passed in on Metal, where they are ordinary parameters.
// Both expand to nothing everywhere else, and go last in the parameter list.
// A device function that uses the helpers above but has none of the indices in scope needs them passed in on Metal, where they are ordinary parameters. Both expand to nothing everywhere else, and go last in the parameter list.
#ifdef __METAL__
#define GPUCA_THREAD_INFO_DECL , int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread
#define GPUCA_THREAD_INFO_PROVIDE , nBlocks, nThreads, iBlock, iThread
Expand All @@ -301,5 +284,4 @@
#define GPUCA_THREAD_INFO_PROVIDE
#endif

// clang-format on
#endif
#endif // clang-format on
44 changes: 20 additions & 24 deletions GPU/Common/GPUCommonMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
#define GPUCA_CHOICE(c1, c2, c3) (c3) // Select third option for OpenCL and Metal
#else
#define GPUCA_CHOICE(c1, c2, c3) (c1) // Select first option for Host
#endif // clang-format on
#endif // clang-format on
#if defined(__METAL__) // TODO: Support double also in Metal, for deterministic results
#define GPUCA_DETERMINISTIC_DOUBLE(dbl, flt) (flt) // Deterministic math functions computed in double where possible, MSL has no double
#else
#define GPUCA_DETERMINISTIC_DOUBLE(dbl, flt) (dbl)
#endif

namespace o2::gpu
{
Expand Down Expand Up @@ -323,16 +328,16 @@ GPUCA_DETERMINISTIC_CODE( // clang-format off
GPUdi() constexpr float GPUCommonMath::Round(float x) { return GPUCA_CHOICE(roundf(x), roundf(x), round(x)); }
GPUdi() constexpr int32_t GPUCommonMath::Float2IntRn(float x) { return (int32_t)Round(x); }
GPUhdi() constexpr float GPUCommonMath::Sqrt(float x) { return GPUCA_CHOICE(sqrtf(x), (float)sqrt((double)x), sqrt(x)); }
GPUdi() constexpr float GPUCommonMath::ATan(float x) { return GPUCA_CHOICE((float)atan((double)x), (float)atan((double)x), atan(x)); }
GPUhdi() constexpr float GPUCommonMath::ATan2(float y, float x) { return GPUCA_CHOICE((float)atan2((double)y, (double)x), (float)atan2((double)y, (double)x), atan2(y, x)); }
GPUdi() constexpr float GPUCommonMath::Sin(float x) { return GPUCA_CHOICE((float)sin((double)x), (float)sin((double)x), sin(x)); }
GPUdi() constexpr float GPUCommonMath::Cos(float x) { return GPUCA_CHOICE((float)cos((double)x), (float)cos((double)x), cos(x)); }
GPUdi() constexpr float GPUCommonMath::ATan(float x) { return GPUCA_CHOICE((float)atan((double)x), (float)atan((double)x), GPUCA_DETERMINISTIC_DOUBLE((float)atan((double)x), atan(x))); }
GPUhdi() constexpr float GPUCommonMath::ATan2(float y, float x) { return GPUCA_CHOICE((float)atan2((double)y, (double)x), (float)atan2((double)y, (double)x), GPUCA_DETERMINISTIC_DOUBLE((float)atan2((double)y, (double)x), atan2(y, x))); }
GPUdi() constexpr float GPUCommonMath::Sin(float x) { return GPUCA_CHOICE((float)sin((double)x), (float)sin((double)x), GPUCA_DETERMINISTIC_DOUBLE((float)sin((double)x), sin(x))); }
GPUdi() constexpr float GPUCommonMath::Cos(float x) { return GPUCA_CHOICE((float)cos((double)x), (float)cos((double)x), GPUCA_DETERMINISTIC_DOUBLE((float)cos((double)x), cos(x))); }
GPUdi() constexpr float GPUCommonMath::Tan(float x) { return GPUCA_CHOICE((float)tanf((double)x), (float)tanf((double)x), tan(x)); }
GPUdi() constexpr float GPUCommonMath::Pow(float x, float y) { return GPUCA_CHOICE((float)pow((double)x, (double)y), pow((double)x, (double)y), pow(x, y)); }
GPUdi() constexpr float GPUCommonMath::ASin(float x) { return GPUCA_CHOICE((float)asin((double)x), (float)asin((double)x), asin(x)); }
GPUdi() constexpr float GPUCommonMath::ACos(float x) { return GPUCA_CHOICE((float)acos((double)x), (float)acos((double)x), acos(x)); }
GPUdi() constexpr float GPUCommonMath::Log(float x) { return GPUCA_CHOICE((float)log((double)x), (float)log((double)x), log(x)); }
GPUdi() constexpr float GPUCommonMath::Exp(float x) { return GPUCA_CHOICE((float)exp((double)x), (float)exp((double)x), exp(x)); }
GPUdi() constexpr float GPUCommonMath::Pow(float x, float y) { return GPUCA_CHOICE((float)pow((double)x, (double)y), pow((double)x, (double)y), GPUCA_DETERMINISTIC_DOUBLE((float)pow((double)x, (double)y), pow(x, y))); }
GPUdi() constexpr float GPUCommonMath::ASin(float x) { return GPUCA_CHOICE((float)asin((double)x), (float)asin((double)x), GPUCA_DETERMINISTIC_DOUBLE((float)asin((double)x), asin(x))); }
GPUdi() constexpr float GPUCommonMath::ACos(float x) { return GPUCA_CHOICE((float)acos((double)x), (float)acos((double)x), GPUCA_DETERMINISTIC_DOUBLE((float)acos((double)x), acos(x))); }
GPUdi() constexpr float GPUCommonMath::Log(float x) { return GPUCA_CHOICE((float)log((double)x), (float)log((double)x), GPUCA_DETERMINISTIC_DOUBLE((float)log((double)x), log(x))); }
GPUdi() constexpr float GPUCommonMath::Exp(float x) { return GPUCA_CHOICE((float)exp((double)x), (float)exp((double)x), GPUCA_DETERMINISTIC_DOUBLE((float)exp((double)x), exp(x))); }
GPUdi() constexpr bool GPUCommonMath::Finite(float x) { return GPUCA_CHOICE(std::isfinite(x), isfinite(x), isfinite(x)); }
GPUdi() constexpr bool GPUCommonMath::IsNaN(float x) { return GPUCA_CHOICE(std::isnan(x), isnan(x), isnan(x)); }
, // !GPUCA_DETERMINISTIC_CODE
Expand All @@ -352,6 +357,7 @@ GPUdi() constexpr float GPUCommonMath::Exp(float x) { return GPUCA_CHOICE(expf(x
GPUdi() constexpr bool GPUCommonMath::Finite(float x) { return true; }
GPUdi() constexpr bool GPUCommonMath::IsNaN(float x) { return false; }
) // clang-format on
#undef GPUCA_DETERMINISTIC_DOUBLE

GPUhdi() void GPUCommonMath::SinCos(float x, float& s, float& c)
{
Expand All @@ -363,8 +369,7 @@ GPUhdi() void GPUCommonMath::SinCos(float x, float& s, float& c)
__sincosf(x, &s, &c);
#elif !defined(GPUCA_GPUCODE_DEVICE) && (defined(__GNU_SOURCE__) || defined(_GNU_SOURCE) || defined(GPUCA_GPUCODE))
sincosf(x, &s, &c);
#elif defined(__METAL__) // MSL's sincos returns sin and takes cos by thread
// reference, so it cannot write through a generic one
#elif defined(__METAL__) // MSL's sincos returns sin and takes cos by thread reference, so it cannot write through a generic one
float metalCos;
s = sincos(x, metalCos);
c = metalCos;
Expand Down Expand Up @@ -568,10 +573,8 @@ GPUhdi() constexpr double GPUCommonMath::Abs<double>(double x)
{
return GPUdoubleBinary64::fromBits(x.bits() & ~GPUCA_B64_SIGN);
}
// metal::fabs is not constant-evaluable, so this also fails to compile if the
// specialisation above is ever dropped and the call falls back to it in float
static_assert(GPUCommonMath::Abs<double>(GPUdoubleBinary64::fromBits(0xBFF0000000000001ULL)).bits() == 0x3FF0000000000001ULL,
"Abs on the emulated double must clear the sign bit and keep every other one");
// metal::fabs is not constant-evaluable, so this also fails to compile if the specialisation above is ever dropped and the call falls back to it in float
static_assert(GPUCommonMath::Abs<double>(GPUdoubleBinary64::fromBits(0xBFF0000000000001ULL)).bits() == 0x3FF0000000000001ULL, "Abs on the emulated double must clear the sign bit and keep every other one");
#else
template <>
GPUhdi() constexpr double GPUCommonMath::Abs<double>(double x)
Expand All @@ -586,13 +589,7 @@ GPUhdi() constexpr int32_t GPUCommonMath::Abs<int32_t>(int32_t x)
return GPUCA_CHOICE(abs(x), abs(x), abs(x));
}

#ifdef __METAL__
// The counters these operate on are plain integers in the transferred structures,
// as they are for CUDA and HIP. MSL's atomic operations want metal::atomic, which
// has the same size and alignment. The overload is picked by address space, and a
// threadgroup pointer has to keep its own: casting one to a device atomic is an
// error while the qualifier is visible, but a generic pointer resolves here to
// device and the cast then goes through silently.
#ifdef __METAL__ // All atomics must have the same size as plain int / float types. Use metal::atomic
template <class T>
GPUdi() threadgroup metal::atomic<T>* GPUCommonMathMetalAtomic(threadgroup T* p)
{
Expand Down Expand Up @@ -697,7 +694,6 @@ GPUdi() void GPUCommonMath::AtomicMinInternal(S* addr, T val)
#endif // GPUCA_GPUCODE
}

// Relaxed, as the device atomics above
template <class T, class S>
GPUdi() T GPUCommonMath::AtomicLoadInternal(S* addr)
{
Expand Down
8 changes: 1 addition & 7 deletions GPU/Common/GPUCommonTypeTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
#include <type_traits>
#endif
#else // OpenCL C++ and Metal, neither of which provides <type_traits>
// Spelled for MSL, which OpenCL C++ also accepts, so both backends share one implementation:
// enum values because program scope variables must be constant (MSL 4.1 spec, sec. 4.2), and
// is_pointer / is_member_pointer forward rather than inherit because MSL has no derived classes
// (sec. 1.5.4). Bare T* / T& need no address space: a partial specialization matches them all.
#ifdef __METAL__
#define GPUCA_TT_PROGRAMSCOPE constant
#else
Expand Down Expand Up @@ -118,9 +114,7 @@ struct is_pointer_t<T*> {
};
template <class T>
struct is_pointer {
#ifdef __METAL__
// A bare T* partial specialization does not match a pointer type deduced from
// an argument, which carries its address space; metal::is_pointer does.
#ifdef __METAL__ // A bare T* partial specialization does not match a pointer type deduced from an argument, which carries its address space; metal::is_pointer does.
enum { value = metal::is_pointer<T>::value };
#else
enum { value = is_pointer_t<typename std::remove_cv<T>::type>::value };
Expand Down
3 changes: 1 addition & 2 deletions GPU/GPUTracking/Base/GPUGeneralKernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ class GPUKernelTemplate
int32_t tmpBroadcast;
int32_t warpPredicateSum[I / GPUCA_WARP_SIZE];
};
#elif defined(__METAL__) && defined(GPUCA_GPUCODE)
// What the Metal work-group collectives in GPUCommonAlgorithm.h go through
#elif defined(__METAL__) && defined(GPUCA_GPUCODE) // For Metal work-group collectives in GPUCommonAlgorithm.h
union {
int32_t tmpBroadcast;
int32_t warpPredicateSum[I / GPUCA_WARP_SIZE];
Expand Down
Loading