mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Added test to verify negative result of clSetKernelArg with CL_INVALID_KERNEL (#2460)
Related to #2282, according to work plan from [here](https://github.com/KhronosGroup/OpenCL-CTS/issues/2282#issuecomment-3069182773)
This commit is contained in:
@@ -726,6 +726,26 @@ REGISTER_TEST(negative_set_immutable_memory_to_writeable_kernel_arg)
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
REGISTER_TEST(negative_invalid_kernel)
|
||||
{
|
||||
cl_int error = CL_SUCCESS;
|
||||
clKernelWrapper kernel;
|
||||
|
||||
clMemWrapper mem = clCreateBuffer(context, CL_MEM_READ_ONLY,
|
||||
sizeof(cl_float), NULL, &error);
|
||||
test_error(error, "clCreateBuffer failed");
|
||||
|
||||
// Run the test - CL_INVALID_KERNEL
|
||||
error = clSetKernelArg(kernel, 0, sizeof(cl_mem), &mem);
|
||||
test_failure_error_ret(
|
||||
error, CL_INVALID_KERNEL,
|
||||
"clSetKernelArg is supposed to fail with CL_INVALID_KERNEL when kernel "
|
||||
"is not a valid kernel object",
|
||||
TEST_FAIL);
|
||||
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
REGISTER_TEST(negative_invalid_arg_index)
|
||||
{
|
||||
cl_int error = CL_SUCCESS;
|
||||
@@ -772,6 +792,7 @@ REGISTER_TEST(negative_invalid_arg_size_local)
|
||||
"clSetKernelArg is supposed to fail with CL_INVALID_ARG_SIZE when 0 is "
|
||||
"passed to a local qualifier kernel argument",
|
||||
TEST_FAIL);
|
||||
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user