This is a test plan for rules for parameter passing to kernels defined in 4.12.4. Rules for parameter passing to kernels.
Other legal types of parameters covered in other groups of tests.
sampled_image_accessor
and unsampled_image_accessor
are expected to be tested in future for passing to kernels in tests for these accessors.
This plan does not include negative tests.
All the tests described below are performed only on the default device that is selected on the CTS command line.
-
Define kernel as a named function object with member variable
a
of tested typeA
and constructor that takessycl::accessor<A, 1>
as a parameter. -
In kernel
operator()
write value of member variablea
to accessor. -
In command group create buffer accessor to a variable
b
of typeA
. -
Use
single_task
withkernel<A>(accessor)
as a parameter. -
Check that after command is executed variable
b
is equal to kernel member variablea
.
-
Create 2 variables of tested type
a
andb
with different values. -
Define kernel as a lambda function with by-copy capture default.
-
In this lambda function copy value of
a
tob
via buffer accessor. -
Check that variables are equal after command with this lambda is executed and buffer destructor is called.