Skip to content

Commit

Permalink
Apply sycl::vec 64 bytes limit
Browse files Browse the repository at this point in the history
KhronosGroup/SYCL-Docs#448 limited sycl::vec
alignment to 64 bytes
  • Loading branch information
KornevNikita committed Sep 19, 2023
1 parent cd2b2cc commit 814e538
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/vector_api/generate_vector_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@
if (!check_vector_values<${type}, ${size}>(swizzledVec, reversed_vals)) {
resAcc[0] = false;
}
if (std::alignment_of<sycl::vec<${type}, ${size}>>::value !=
sizeof(${type}) * (${size} == 3 ? 4 : ${size})) {
auto expectedAlignment = sizeof(${type}) * (${size} == 3 ? 4 : ${size});
auto actualAlignment =
std::alignment_of<sycl::vec<${type}, ${size}>>::value;
// Maximum alignment is limited to 64 by SYCL2020
if (actualAlignment != expectedAlignment && expectedAlignment <= 64) {
resAcc[0] = false;
}
if (!check_convert_as_all_types<${type}, ${size}>(inputVec)) {
Expand Down

0 comments on commit 814e538

Please sign in to comment.