Skip to content

Commit 579f461

Browse files
committed
Forbid setting values for non-existent kernel args
1 parent 94f102a commit 579f461

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

sycl/doc/extensions/proposed/sycl_ext_oneapi_free_function_kernels.asciidoc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,15 @@ arguments when the kernel is enqueued.
616616
For example, when enqueuing a kernel with `handler::parallel_for` or
617617
`handler::single_task`, the kernel argument values must be set via
618618
`handler::set_arg` or `handler::set_args`.
619-
Failing to set the value of a kernel argument results in undefined behavior.
620-
The type of the value passed to `handler::set_arg` or `handler::set_args` must
621-
be the same as the type of the corresponding formal parameter in the free
622-
function kernel.
623-
Passing a value with a mismatched type results in undefined behavior.
619+
The application must abide by the following rules, otherwise the behavior is
620+
undefined:
621+
622+
* The application must set a value for each kernel argument.
623+
* The application must not set a value for a kernel argument that does not
624+
exist (e.g. specifying an argument index to `handler::set_arg` that is out of
625+
range).
626+
* The type of the expression used to set the argument's value must match the
627+
type of the corresponding formal parameter in the free function kernel.
624628

625629
=== Obtaining the iteration id for a kernel
626630

0 commit comments

Comments
 (0)