Skip to content

GPU: reach global memory through the generic address space on Metal - #15936

Merged
ktf merged 1 commit into
AliceO2Group:devfrom
ktf:pr15936
Oct 12, 2026
Merged

ktf merged 1 commit into
AliceO2Group:devfrom
ktf:pr15936

Conversation

@ktf

@ktf ktf commented Oct 12, 2026

Copy link
Copy Markdown
Member

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.

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.
@ktf
ktf requested a review from davidrohr as a code owner October 12, 2026 09:36
@ktf
ktf merged commit 17bbe19 into AliceO2Group:dev Oct 12, 2026
5 checks passed
@ktf

ktf commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

Metal only, not tested. Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant