-
Notifications
You must be signed in to change notification settings - Fork 115
Simplify new_kernel_name
implementation in tests
#2128
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?
Simplify new_kernel_name
implementation in tests
#2128
Conversation
eae40da
to
fc30465
Compare
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.
Can we take this opportunity to consolidate this to a single instance of this implementation?
Is there a reason there are 2 nested copies of |
In any case now template <typename Policy>
using __policy_kernel_name = typename ::std::decay_t<Policy>::kernel_name; |
Yes, but in your "after" result, we still have 2 nested |
As example I have used the policy creation at Line 74 in f5bd154
auto new_policy = make_new_policy<new_kernel_name<Policy, 0>>(exec); at this point the type of So I think it's the question for test environment staff, not for
template <::std::size_t CallNumber = 0>
struct invoke_on_all_hetero_policies::operator()(Op op, Args&&... rest) |
9ea0453
to
d3cff9c
Compare
d19308f
to
592fc8c
Compare
eae2814
to
db08779
Compare
…e implementation in tests
…lementation in tests
db08779
to
b2f1493
Compare
…_impl # Conflicts: # test/support/utils_invoke.h
…ed now in utils_sycl_defs.h
…efined now in utils_sycl_defs.h
… now in utils_sycl_defs.h
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.
Pull Request Overview
This PR centralizes and simplifies the new_kernel_name
machinery for tests by moving common templates into a single header and removing redundant definitions elsewhere.
- Introduce
uniq_kernel_index
,unique_kernel_name
, andnew_kernel_name
inutils_sycl_defs.h
- Remove duplicated template definitions from
utils_invoke.h
,test_dynamic_selection_utils.h
, andtest_dynamic_load_utils.h
- Include
utils_sycl_defs.h
where those utilities were previously declared inline
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
test/support/utils_sycl_defs.h | Added uniq_kernel_index , forward-declared unique_kernel_name , and new_kernel_name alias |
test/support/utils_invoke.h | Removed inline duplicates and included utils_sycl_defs.h |
test/support/test_dynamic_selection_utils.h | Removed inline duplicates and included utils_sycl_defs.h |
test/support/test_dynamic_load_utils.h | Removed inline duplicates and included utils_sycl_defs.h |
Comments suppressed due to low confidence (3)
test/support/utils_sycl_defs.h:44
- [nitpick] Consider renaming
uniq_kernel_index
tounique_kernel_index
for consistency withunique_kernel_name
and to improve readability.
uniq_kernel_index()
test/support/utils_sycl_defs.h:49
- [nitpick] Add a brief comment above this forward declaration to explain the purpose of
unique_kernel_name
and how it is used in the test framework.
template <typename Op, std::size_t CallNumber>
test/support/utils_sycl_defs.h:42
- Consider adding unit tests for
uniq_kernel_index
to verify that it returns the correct numeric values for eachsycl::usm::alloc
enumerator.
template <sycl::usm::alloc alloc_type>
In this PR we simplify
new_kernel_name
implementation in tests.The goal - to make generated new Kernel names more short and simple.
Example
Let's take a look to the code (for example):
new_policy
isnew_policy
is