KhronosGroup / KhronosGroup/OpenCL-Docs

Should `binary_status[i]` be set in clCreateProgramWithBinary if `lengths[i]` is zero or `binaries[i]` is NULL?

Open
#1,203 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-cts-coverage
Dominant language
Python
Stars
421
Forks
132
Avg merge
5d 13h
Merged PRs (30d)
11

Description

Hi

Suppose that (lengths[i] == 0 || binaries[i] == NULL) && binary_status != NULL in clCreateProgramWithBinary.
Should binary_status[i] be set to CL_INVALID_VALUE in that case?

The spec currently says:

binary_status returns whether the program binary for each device specified in device_list was loaded successfully or not. It is an array of num_devices entries and returns CL_SUCCESS in binary_status[i] if binary was successfully loaded for device specified by device_list[i]; otherwise returns CL_INVALID_VALUE if lengths[i] is zero or if binaries[i] is a NULL value or CL_INVALID_BINARY in binary_status[i] if program binary is not a valid binary for the specified device. If binary_status is NULL, it is ignored.

CL_INVALID_VALUE if lengths or binaries is NULL or if any entry in lengths[i] is zero or binaries[i] is NULL.

CL_INVALID_BINARY if an invalid program binary was encountered for any device. binary_status will return specific status for each device.

If yes, it would be good to add the sentence "binary_status will return specific status for each device." to the documentation of the CL_INVALID_VALUE return value and to add "in binary_status[i]" to CL_INVALID_VALUE within the documentation of binary_status.

If no, it would be clearer to remove any mention CL_INVALID_VALUE from the documentation of binary_status.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the cited clCreateProgramWithBinary specification text, especially the binary_status and CL_INVALID_VALUE descriptions. Compare whether per-device invalid-input statuses are intended, then resolve the wording consistently; done means the affected documentation clearly states the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.