Skip to content

Commit

Permalink
Merge pull request #819 from KornevNikita/fix-sub-group-mask-test
Browse files Browse the repository at this point in the history
Fix sub_group_mask_constructors
  • Loading branch information
bader authored Nov 4, 2023
2 parents b4349e4 + 86b7552 commit 5febc56
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ void copy_ulong_long2marray(sycl::marray<T, dim>& marray,
elem_size * dim > sizeof(value) ? sizeof(value) : elem_size * dim;
size_t shift = 0;
size_t i = 0;
auto valuePtr = reinterpret_cast<char*>(&value);
while (shift + elem_size <= num_bytes && i < dim) {
memcpy(&(marray[i]), &value + shift, elem_size);
memcpy(&(marray[i]), valuePtr + shift, elem_size);
++i;
shift += elem_size;
}
Expand All @@ -52,8 +53,9 @@ void copy_marray2ulong_long(unsigned long long& value,
elem_size * dim > sizeof(value) ? sizeof(value) : elem_size * dim;
size_t shift = 0;
size_t i = 0;
auto valuePtr = reinterpret_cast<char*>(&value);
while (shift + elem_size <= num_bytes && i < dim) {
memcpy(&value + shift, &(marray[i]), elem_size);
memcpy(valuePtr + shift, &(marray[i]), elem_size);
++i;
shift += elem_size;
}
Expand Down

0 comments on commit 5febc56

Please sign in to comment.