Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIR-V: Which storage classes allow initializers? #554

bashbaug opened this issue Feb 3, 2021 · 0 comments

SPIR-V: Which storage classes allow initializers? #554

bashbaug opened this issue Feb 3, 2021 · 0 comments
SPIR-V Environment Spec


Copy link

@bashbaug bashbaug commented Feb 3, 2021

The OpenCL C spec says that a local variable cannot have an initializer:

Variables allocated in the __local address space inside a kernel function cannot be initialized.

However, we have no similar restriction in the OpenCL SPIR-V Environment Spec, and I think we should.

Specifically, I think that we should support initializers for the storage classes:

  • Function (equivalent of OpenCL private memory)
  • UniformConstant (equivalent of OpenCL constant memory - initializer required)
  • CrossWorkgroup (equivalent of OpenCL global memory, when program scope global variables are supported)

We wouldn't support initializers for:

  • Input (this is documented in the SPIR-V spec)
  • Workgroup (equivalent of OpenCL local memory)
@bashbaug bashbaug added the SPIR-V Environment Spec label Feb 3, 2021
@bashbaug bashbaug added this to To do in OpenCL specification maintenance via automation Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
SPIR-V Environment Spec

No branches or pull requests

1 participant