-
Notifications
You must be signed in to change notification settings - Fork 223
Added test to verify negative result of clSetKernelArg with CL_INVALID_DEVICE_QUEUE #2462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
496bdbe
acac332
78b3552
b35ded9
39c4338
6b049c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |||||||||||||||||||||||||||
| #include "testBase.h" | ||||||||||||||||||||||||||||
| #include "harness/typeWrappers.h" | ||||||||||||||||||||||||||||
| #include "harness/conversions.h" | ||||||||||||||||||||||||||||
| #include "harness/featureHelpers.h" | ||||||||||||||||||||||||||||
| #include <vector> | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| const char *sample_single_test_kernel[] = { | ||||||||||||||||||||||||||||
|
|
@@ -87,6 +88,17 @@ const char *sample_two_kernel_program[] = { | |||||||||||||||||||||||||||
| "\n" | ||||||||||||||||||||||||||||
| "}\n" }; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| const char *sample_queue_test_kernel = R"( | ||||||||||||||||||||||||||||
| __kernel void enqueue_call_func() { | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| __kernel void queue_test(queue_t queue) | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| ndrange_t ndrange = ndrange_1D(1); | ||||||||||||||||||||||||||||
| enqueue_kernel(queue, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange, | ||||||||||||||||||||||||||||
| ^{enqueue_call_func();}); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| )"; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| const char *sample_read_only_image_test_kernel = R"( | ||||||||||||||||||||||||||||
| __kernel void read_only_image_test(__write_only image2d_t img, __global uint4 *src) | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
|
|
@@ -718,6 +730,44 @@ REGISTER_TEST(negative_set_immutable_memory_to_writeable_kernel_arg) | |||||||||||||||||||||||||||
| return TEST_PASS; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| REGISTER_TEST(negative_invalid_arg_queue) | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| OpenCLCFeatures features; | ||||||||||||||||||||||||||||
| get_device_cl_c_features(device, features); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| const Version clc_version = get_device_latest_cl_c_version(device); | ||||||||||||||||||||||||||||
| if ((clc_version < Version(2, 0)) | ||||||||||||||||||||||||||||
| || !features.supports__opencl_c_device_enqueue) | ||||||||||||||||||||||||||||
| return TEST_SKIPPED_ITSELF; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| std::string build_opts = "-cl-std=CL" + clc_version.to_string(); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| cl_int error = CL_SUCCESS; | ||||||||||||||||||||||||||||
| clProgramWrapper program; | ||||||||||||||||||||||||||||
| clKernelWrapper queue_arg_kernel; | ||||||||||||||||||||||||||||
| clCommandQueueWrapper queue_arg; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| // Setup the test | ||||||||||||||||||||||||||||
| error = create_single_kernel_helper(context, &program, nullptr, 1, | ||||||||||||||||||||||||||||
| &sample_queue_test_kernel, "queue_test", | ||||||||||||||||||||||||||||
| build_opts.c_str()); | ||||||||||||||||||||||||||||
| test_error(error, "Unable to build test program"); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| queue_arg_kernel = clCreateKernel(program, "queue_test", &error); | ||||||||||||||||||||||||||||
| test_error(error, "Unable to get queue_test kernel for built program"); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
| // Setup the test | |
| error = create_single_kernel_helper(context, &program, nullptr, 1, | |
| &sample_queue_test_kernel, "queue_test", | |
| build_opts.c_str()); | |
| test_error(error, "Unable to build test program"); | |
| queue_arg_kernel = clCreateKernel(program, "queue_test", &error); | |
| test_error(error, "Unable to get queue_test kernel for built program"); | |
| // Setup the test | |
| error = create_single_kernel_helper(context, &program, &queue_arg_kernel, 1, | |
| &sample_queue_test_kernel, "queue_test", | |
| build_opts.c_str()); | |
| test_error(error, "Unable to create test kernel"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected
Uh oh!
There was an error while loading. Please reload this page.