Skip to content

Commit 76ee600

Browse files
committed
GPU OpenCL: OpenCL >=2 should use generic address space for pointer kernel arguments, otherwise clang fails to derive the address space if used in a variadic template
1 parent 4830054 commit 76ee600

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

GPU/GPUTracking/Definitions/GPUDef.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
// Macros for masking ptrs in OpenCL kernel calls as uint64_t (The API only allows us to pass buffer objects)
2626
#ifdef __OPENCL__
2727
#define GPUPtr1(a, b) uint64_t b
28-
#define GPUPtr2(a, b) ((__global a) (a) b)
28+
#ifdef __OPENCLCPP__
29+
#define GPUPtr2(a, b) ((__generic a) (a) b)
30+
#else
31+
#define GPUPtr2(a, b) ((__global a) (a) b)
32+
#endif
2933
#else
3034
#define GPUPtr1(a, b) a b
3135
#define GPUPtr2(a, b) b

0 commit comments

Comments
 (0)