Skip to content

Commit aebfbbc

Browse files
committed
GPUCommon: place the GPU common constants in the constant address space
MSL requires every variable at program scope, class-scope statics included, to name an address space. GPUglobalconstexpr() expands to constexpr everywhere except Metal, so this is a no-op for host, CUDA, HIP, OpenCL and cling. These were missed by the earlier pass: the header they sit in only started being compiled once the errors ahead of it were gone.
1 parent 721111d commit aebfbbc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎GPU/Common/GPUCommonConstants.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
namespace o2::gpu::gpu_common_constants
2121
{
22-
static constexpr const float kCLight = 0.000299792458f; // TODO: Duplicate of MathConstants, fix this now that we use only OpenCL CPP
23-
static constexpr const float kZeroFieldCut = 0.013f;
22+
static GPUglobalconstexpr() const float kCLight = 0.000299792458f; // TODO: Duplicate of MathConstants, fix this now that we use only OpenCL CPP
23+
static GPUglobalconstexpr() const float kZeroFieldCut = 0.013f;
2424
}
2525

2626
#endif

0 commit comments

Comments
 (0)