KhronosGroup / KhronosGroup/OpenCL-Docs

clSetKernelArg with arg_value equal to NULL

Open
#1,506 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
420
Forks
131
Avg merge
5d 13h
Merged PRs (30d)
11

Description

Slightly related to #1504 in that both are related to clSetKernelArg error conditions, and found while reviewing the various CTS additions for negative testing for clSetKernelArg.

The latest spec updates clearly describe the behavior in several cases when clSetKernelArg is passed arg_value equal to NULL:

> If the kernel argument being set is a pointer to the global or constant address space, then arg_value must point to a buffer memory object or NULL, or arg_value must be NULL. If arg_value is NULL or points to NULL, then the kernel argument will be set to NULL.
>
> If the kernel argument being set is a pointer to the local address space, then arg_value must be NULL, and arg_size specifies the amount of local memory in bytes that are allocated for the kernel argument.

It is not clear what should happen when arg_value is equal to NULL in other cases, though. Specifically, what should the behavior be:

1. when the kernel argument is an image?
2. when the kernel argument is a sampler?
3. when the kernel argument is a device queue?
4. when the kernel argument is a pipe?
5. when the kernel argument is a data value?

If all of these are an error (and I think they should be), which error code should be returned in each case?

Contributor guide

Open the contributing guide

Research direction

No file or test is identified. Start by reviewing the latest specification text for clSetKernelArg and the related discussion in #1504, then resolve the expected behavior and error code for NULL arg_value across images, samplers, device queues, pipes, and data values. Done means the specification clearly documents each case.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.