Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Fix bug and improve strength of simd_view_copy_move_assign.cpp. #877

Merged
merged 1 commit into from
Mar 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions SYCL/ESIMD/api/simd_view_copy_move_assign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ bool test(queue q, std::string str, F funcUnderTest) {
// The expected result gets the first half of values from B,
int gold[VL];
for (int i = 0; i < VL; ++i) {
A[i] = -i;
B[i] = i;
gold[i] = (i < HalfVL) ? B[i] : A[i];
A[i] = -i - 1;
B[i] = i + 1;
gold[i] = ((VL > 1) && (i < HalfVL)) ? B[i] : A[i];
}

try {
Expand All @@ -57,8 +57,8 @@ bool test(queue q, std::string str, F funcUnderTest) {
simd<T, VL> va;
simd<T, VL> vb;
if constexpr (VL == 1) {
va[0] = PA[0];
vb[0] = PB[0];
va[0] = scalar_load<T>(PA, 0);
vb[0] = scalar_load<T>(PB, 0);
} else {
va.copy_from(PA, offset);
vb.copy_from(PB, offset);
Expand All @@ -69,7 +69,7 @@ bool test(queue q, std::string str, F funcUnderTest) {
funcUnderTest(va_view, vb_view);

if constexpr (VL == 1) {
PA[0] = va[0];
scalar_store(PB, 0, (T)va[0]);
} else {
va.copy_to(PA, offset);
}
Expand Down