KhronosGroup / KhronosGroup/OpenCL-Docs
returning CL_INVALID_OPERATION from clSetProgramSpecializationConstant
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 421
- Forks
- 132
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 11
Description
When we made IL programs optional in OpenCL 3.0, we added the error condition for clSetProgramSpecializationConstant:
CL_INVALID_OPERATION if no devices associated with program support intermediate language programs.
Note that clSetProgramSpecializationConstant also has the error condition:
CL_INVALID_PROGRAM if program is not a valid program object created from an intermediate language (e.g. SPIR-V), or if the intermediate language does not support specialization constants.
In the description of clCreateProgramWithIL, though, we also have the error condition:
CL_INVALID_OPERATION if no devices in context support intermediate language programs.
This means:
- If no devices in the context support intermediate language programs, it is impossible to create a valid program object created from an intermediate language, because clCreateProgramWithIL will return an error.
- Therefore, the CL_INVALID_OPERATION error condition for clSetProgramSpecializationConstant is debatably redundant and unnecessary, because in all of the conditions when it could be returned it will also be a CL_INVALID_PROGRAM.
We have a "consistency check" CTS test for this scenario, but note that the error could just as correctly be CL_INVALID_PROGRAM (since the program is created from source) as it could be CL_INVALID_OPERATION (since no devices associated with the program support IL programs).
Should we remove this error condition (and update the CTS)? Or, is there a different way we should phrase the error condition, instead?
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 clSetProgramSpecializationConstant and clCreateProgramWithIL error conditions in the linked OpenCL specification sections. Then inspect test_conformance/api/test_api_consistency.cpp around line 955. Done means the error wording has an agreed resolution and the consistency test is updated to match it.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation, testing
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100