Skip to content

Commit 4c9d8a4

Browse files
authored
Specify what state kernel objects are in after a failed call to clSetKernelArg (#705)
* Specify what state kernel objects are in after a failed call to clSetKernelArg Fixes #548 Signed-off-by: Kevin Petit <kevin.petit@arm.com> Change-Id: Ibcc63c7f6e19bff4169c22e16f3ff4dacf2b6e25 * address review comments Change-Id: I04665e6cbb60577d427e58b90464418e58cefbe5
1 parent f773331 commit 4c9d8a4

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

api/footnotes.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,7 @@ Only once the ID has been allotted may it be exposed to OpenCL by proposing a me
162162
The merge must define a new enumerant by adding an `<enum>` tag to the {cl_khronos_vendor_id_TYPE} `<enums>` tag, with the `<value>` attribute set as the acquired Khronos vendor ID. \
163163
The `<name>` attribute must identify the vendor/adopter, and be of the form `CL_KHRONOS_VENDOR_ID_<vendor>`. \
164164
]
165+
166+
:fn-setkernelarg-prefer-unset-on-error: pass:n[ \
167+
Implementations are encouraged to favor this option as it makes it more likely that errors will be managed by applications. \
168+
]

api/opencl_runtime_layer.asciidoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7219,6 +7219,16 @@ Otherwise, it returns one of the following errors:
72197219
by the OpenCL implementation on the device.
72207220
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources
72217221
required by the OpenCL implementation on the host.
7222+
7223+
When {clSetKernelArg} returns an error code different from {CL_SUCCESS}, the
7224+
internal state of _kernel_ may only be modified when that error code is
7225+
{CL_OUT_OF_RESOURCES} or {CL_OUT_OF_HOST_MEMORY}. When the internal state
7226+
of _kernel_ is modified, it is implementation-defined whether:
7227+
7228+
* The argument value that was previously set is kept so that it can be used in
7229+
further kernel enqueues.
7230+
* The argument value is unset such that a subsequent kernel enqueue fails with
7231+
{CL_INVALID_KERNEL_ARGS}. footnote:[{fn-setkernelarg-prefer-unset-on-error}]
72227232
--
72237233

72247234
[open,refpage='clSetKernelArgSVMPointer',desc='Set a SVM pointer as the argument value for a specific argument of a kernel.',type='protos']

0 commit comments

Comments
 (0)