-
Notifications
You must be signed in to change notification settings - Fork 769
Implement sycl_khr_work_item_queries
extension
#18519
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: sycl
Are you sure you want to change the base?
Conversation
Signed-off-by: Michael Aziz <[email protected]>
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.
Looks good overall! One test nit.
|
||
#include <sycl/ext/oneapi/free_function_queries.hpp> | ||
|
||
#define SYCL_KHR_WORK_ITEM_QUERIES 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.
I see this is how we do it in khr/group_interface.hpp too, but would it be more appropriate to guard the definition in sycl/source/feature_test.hpp.in together with all the other feature test macros?
for (const auto &result : acc) | ||
assert(result); |
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.
Nit; Asserts stop execution immediately, so personally I prefer to do something like:
for (const auto &result : acc) | |
assert(result); | |
for (const auto &result : acc) { | |
if (!result) { | |
std::cout << "Failed check_this_nd_item_api check for dimensionality " << Dimensions << ".\n"; | |
return 1; | |
} | |
} | |
return 0; |
and then in the main function you do:
int Failed = 0;
// nd_item
Failed += check_this_nd_item_api<2>();
Failed += check_this_nd_item_api<2, 3>();
Failed += check_this_nd_item_api<2, 3, 4>();
// group
Failed += check_this_group_api<2>();
Failed += check_this_group_api<2, 3>();
Failed += check_this_group_api<2, 3, 4>();
// sub_group
Failed += check_this_sub_group_api<2>();
Failed += check_this_sub_group_api<2, 3>();
Failed += check_this_sub_group_api<2, 3, 4>();
return Failed;
The more information, the better.
Implements the extension defined in KhronosGroup/SYCL-Docs#682.