Skip to content

Commit 17bbe19

Browse files
authored
GPU: reach global memory through the generic address space on Metal (#15936)
GPUglobalref() expanded to device, which is what the OpenCL 1 port needed. It no longer matches the code: since the constant address space was dropped, the objects the kernels work on are reached through a generic `this`, so a member pointer or the address of a member is a generic pointer, and MSL will not pass one where a device pointer is wanted. MSL 4.1's generic address space spans device, threadgroup and thread, so leaving the annotation off is correct for every one of these. This mirrors the OpenCL C++ branch, where GPUglobalref() is likewise empty and GPUgeneric() carries the annotation. GPUsharedref() and GPUconstantref() stay explicit: threadgroup is still worth pinning where it is known, and constant is not reachable through a generic pointer at all.
1 parent 7c19dff commit 17bbe19

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎GPU/Common/GPUCommonDefAPI.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
#define GPUnoexcept()
167167
#define GPUprivate() thread
168168
#define GPUgeneric()
169-
#define GPUglobalref() device
169+
#define GPUglobalref()
170170
#define GPUsharedref() threadgroup
171171
#define GPUprivateref() thread
172172
#define GPUconstexprref() GPUconstexpr()

0 commit comments

Comments
 (0)