Conversation
macOS ships OpenCL 1.2, below the 2.x the OpenCL backend requires, so find_package(OpenCL) there could never produce a usable backend: the version check dropped it again a few lines later. Skip the lookup on Apple instead. With that, CUDA_ENABLED, OPENCL_ENABLED and HIP_ENABLED are all necessarily off on macOS, which makes the Darwin arm of the backend dispatch dead code. Drop it along with its warning and unindent the rest.
The MSL generic address space covers device, threadgroup and thread but not constant, so a generic member function cannot be called on an object that lives in constant memory: 'cannot initialize object parameter of type X with an expression of type constant X'. The shared code is generic throughout, so constant memory is simply not usable on this backend. Metal therefore implies GPUCA_NO_CONSTANT_MEMORY, which already exists for the other backends and redirects GPUconstant() to GPUglobal(). GPUconstantref() has to follow it, exactly as the OpenCL block already arranges; the Metal block hardcoded 'constant' and so kept handing out constant references whatever the setting. It now falls through to the unannotated, and therefore generic, fallback. Macro expansions are unchanged for host, CUDA, HIP, OpenCL and cling. Takes the Metal translation unit from 333 errors to 235, of which the constant-versus-generic diagnostics drop from 91 to 14.
This was referenced Sep 21, 2026
Collaborator
|
Error while checking build/O2/fullCI_slc9 for 99542dd at 2026-09-21 21:48: Full log here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The MSL generic address space covers device, threadgroup and thread but not
constant, so a generic member function cannot be called on an object that lives
in constant memory: 'cannot initialize object parameter of type X with an
expression of type constant X'. The shared code is generic throughout, so
constant memory is simply not usable on this backend.
Metal therefore implies GPUCA_NO_CONSTANT_MEMORY, which already exists for the
other backends and redirects GPUconstant() to GPUglobal(). GPUconstantref() has
to follow it, exactly as the OpenCL block already arranges; the Metal block
hardcoded 'constant' and so kept handing out constant references whatever the
setting. It now falls through to the unannotated, and therefore generic,
fallback.
Macro expansions are unchanged for host, CUDA, HIP, OpenCL and cling.
Takes the Metal translation unit from 333 errors to 235, of which the
constant-versus-generic diagnostics drop from 91 to 14.
Stack created with Sapling. Best reviewed with ReviewStack.