KhronosGroup / KhronosGroup/OpenCL-Docs
SPIR-V: Which storage classes allow initializers?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 421
- Forks
- 131
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 11
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the OpenCL C specification with the OpenCL SPIR-V Environment Specification, focusing on initializer rules for the Function, UniformConstant, CrossWorkgroup, Input, and Workgroup storage classes. Done means the SPIR-V environment specification clearly states which storage classes permit or prohibit initializers, including the required initializer for UniformConstant.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100