-
Notifications
You must be signed in to change notification settings - Fork 199
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
Added test for work-item functions with out-of-range arguments #2099
base: main
Are you sure you want to change the base?
Conversation
|
||
const char *outOfRangeWorkItemKernelCodeExt = | ||
R"( | ||
uint dimindx=get_work_dim()+1; |
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.
A smart compiler would still be able to prove at compile time that this dimidx
is out-of-range.
If you want to be sure the compiler cannot prove that the dimidx
is out-of-range, it'd be better to pass it as a kernel argument.
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.
Argument passed
|
||
int test_work_item_functions(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements) | ||
const char *outOfRangeWorkItemKernelCodeExt11 = |
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.
Could we use a single kernel for this stuff, and guard the parts that are specific to newer OpenCL C versions using __OPENCL_VERSION__
or some other preprocessor mechanism? I think that would be easier to understand and maintain vs. stitching together these sample kernels with sprintf
.
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.
Done, variants replaced with __OPENCL_VERSION__
preprocessor conditions
kernel_source(src), max_workgroup_size(0) | ||
{} | ||
|
||
virtual cl_int SetUp(const char *kernel_source) |
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.
Something doesn't seem right here - we have a kernel_source
member variables and a kernel_source
function argument. Do we need both?
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.
Done, param renamed
Fixes #2005 according to task description.