From 8a3c9d27e6c29eee716c776ee98904ab0c53fa82 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 12 Oct 2026 11:16:23 +0200 Subject: [PATCH] GPU: reach global memory through the generic address space on Metal 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. --- GPU/Common/GPUCommonDefAPI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/Common/GPUCommonDefAPI.h b/GPU/Common/GPUCommonDefAPI.h index a294ea6e81b19..febe2dbd0ad0d 100644 --- a/GPU/Common/GPUCommonDefAPI.h +++ b/GPU/Common/GPUCommonDefAPI.h @@ -166,7 +166,7 @@ #define GPUnoexcept() #define GPUprivate() thread #define GPUgeneric() - #define GPUglobalref() device + #define GPUglobalref() #define GPUsharedref() threadgroup #define GPUprivateref() thread #define GPUconstexprref() GPUconstexpr()