-
Notifications
You must be signed in to change notification settings - Fork 82
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
Refactor vector_swizzles
test
#825
Refactor vector_swizzles
test
#825
Conversation
This is a partial refactoring of the test, which aims to: - reduce kernel size, which allows to speed up JIT compilation and therefore test execution - improve error reporting from the test, by returning more than just a single boolean value for all of the checks performed by kernels Main changes: - introduced new template for swizzle test - "basic" `.swizzle<>()` checks now report results back to host where their verification happens instead of doing so on device side
…/refactor-vector-swizzles
if (!check_equal_type_bool<sycl::vec<${type}, ${size}>>(inOrderSwizzleFunctionVec)) { | ||
resAcc[0] = false; | ||
} | ||
if (!check_vector_size<${type}, ${size}>(inOrderSwizzleFunctionVec)) { | ||
resAcc[0] = false; | ||
} | ||
if (!check_vector_values<${type}, ${size}>(inOrderSwizzleFunctionVec, in_order_vals)) { |
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.
Note for reviewers: there are two templates for kernel code:
- one for vectors with 4 or less elements, which is used to exercise all simple swizzles like
.xyzw
; modifiedswizzle_elem_template
is its part - another one for bigger vectors, where only per-element swizzles are tested;
swizzle_full_test_template
is used for it
Kernels for both categories of vectors do the same checks to ensure that .swizzle
method returns elements in the right order, they are just described by two different code templates.
Ideally, we should get a better rewrite of the test to be able to emit separate error message for (almost) every check performed by the test, so SYCL implementors can quickly understand which exact operation doesn't work properly. Plus, we do not test swizzles functionality on host where it should also work, according to the SYCL 2020 specification. However, I'm not able to provide such a rewrite at the moment. Nevertheless, I would appreciate if this partial refactoring is accepted, as it greatly helps to reduce to reduce amount of code emitted for device. I don't have pure numbers, because I have some local changes applied to |
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.
Thanks.
You can probably add your idea for further refactoring as a TODO comment somewhere so it is not lost.
Recorded key points in 35fbe65 |
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.
Thanks for the on-coming generations of developers. :-)
This is a partial refactoring of the test, which aims to:
bool
value for all of the checks performed by kernelsMain changes:
.swizzle<s0, s1, ..., sN>()
operations are now reported back to host where their verification happens instead of doing so on device side