Skip to content

Commit b1e5f4e

Browse files
kbobrovsbb-sycl
authored andcommitted
[ESIMD] Enable testcases with variable scatter mask, after compiler fix. (intel#847)
Signed-off-by: Konstantin S Bobrovsky <[email protected]>
1 parent f78d933 commit b1e5f4e

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

SYCL/ESIMD/api/slm_gather_scatter_heavy.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,11 @@ template <class T, unsigned VL, unsigned STRIDE> bool test(queue q) {
426426
passed &= test_impl<T, VL, STRIDE, MEM_GATHER, TEST_SCALAR>(q);
427427
passed &= test_impl<T, VL, STRIDE, MEM_GATHER, TEST_VECTOR_NO_MASK>(q);
428428
passed &= test_impl<T, VL, STRIDE, MEM_GATHER, TEST_VECTOR_CONST_MASK>(q);
429-
// TODO FIXME enable TEST_VECTOR_VAR_MASK test cases once the VCBE bug with
430-
// handling non-compile-time constant masks in scatter is fixed.
431-
// passed &= test_impl<T, VL, STRIDE, MEM_GATHER, TEST_VECTOR_VAR_MASK>(q);
429+
passed &= test_impl<T, VL, STRIDE, MEM_GATHER, TEST_VECTOR_VAR_MASK>(q);
432430
passed &= test_impl<T, VL, STRIDE, MEM_SCATTER, TEST_SCALAR>(q);
433431
passed &= test_impl<T, VL, STRIDE, MEM_SCATTER, TEST_VECTOR_NO_MASK>(q);
434432
passed &= test_impl<T, VL, STRIDE, MEM_SCATTER, TEST_VECTOR_CONST_MASK>(q);
435-
// passed &= test_impl<T, VL, STRIDE, MEM_SCATTER, TEST_VECTOR_VAR_MASK>(q);
433+
passed &= test_impl<T, VL, STRIDE, MEM_SCATTER, TEST_VECTOR_VAR_MASK>(q);
436434
return passed;
437435
}
438436

SYCL/ESIMD/regression/variable_gather_mask.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
// UNSUPPORTED: cuda || hip
1010
// RUN: %clangxx -fsycl %s -o %t.out
1111
// RUN: %GPU_RUN_PLACEHOLDER %t.out
12-
// XFAIL: *
13-
// TODO: once BE problem is fixed and this test starts to pass, need to also
14-
// enable TEST_VECTOR_VAR_MASK test cases in slm_gather_scatter_heavy.cpp
1512
//
1613
// This is a regression test for the VC BE bug which generates incorrect code in
1714
// some cases in presence of variable (not compile-time constant) mask
@@ -44,16 +41,16 @@ struct KernelAcc {
4441
#endif
4542
#ifdef USE_RAW_API
4643
constexpr int val = MASKED_LANE;
47-
simd<int, VL>::vector_type v{val, val, val, val, val, val, val, val};
48-
simd_mask<VL>::vector_type pred{1, 1, 1, 1, 1, 1, 1, 1};
44+
simd<int, VL>::raw_vector_type v{val, val, val, val, val, val, val, val};
45+
simd_mask<VL>::raw_vector_type pred{1, 1, 1, 1, 1, 1, 1, 1};
4946
pred[masked_lane] = 0;
5047
#if defined(USE_WORKAROUND)
51-
pred = __builtin_convertvector(pred == 1, simd_mask<VL>::vector_type);
48+
pred = __builtin_convertvector(pred == 1, simd_mask<VL>::raw_vector_type);
5249
#endif
53-
simd<uint32_t, VL>::vector_type offsets = {0, 4, 8, 12, 16, 20, 24, 28};
50+
simd<uint32_t, VL>::raw_vector_type offsets = {0, 4, 8, 12, 16, 20, 24, 28};
5451
SurfaceIndex si = get_surface_index(acc);
55-
__esimd_scatter_scaled<int, VL, unsigned int, 2, 0, CacheHint::None,
56-
CacheHint::None>(pred, si, 0, offsets, v);
52+
__esimd_scatter_scaled<int, VL, unsigned int, 2, 0>(pred, si, 0, offsets,
53+
v);
5754
#else
5855
simd<int, VL> v(MASKED_LANE);
5956
simd_mask<VL> pred = 1;
@@ -138,7 +135,7 @@ int main(int argc, char **argv) {
138135
std::cout << "Running on " << dev.get_info<info::device::name>() << "\n";
139136
std::cout << "MaskedLane=" << MASKED_LANE << "\n";
140137

141-
bool passed = false;
138+
bool passed = true;
142139

143140
passed &= test("accessor", q, [&](int *B) {
144141
sycl::buffer<int, 1> Bbuf(B, range<1>(VL));
@@ -157,6 +154,6 @@ int main(int argc, char **argv) {
157154
});
158155
});
159156

160-
std::cout << (passed ? "Test FAILED\n" : "Test passed\n");
157+
std::cout << (passed ? "Test passed\n" : "Test FAILED\n");
161158
return passed ? 0 : 1;
162159
}

0 commit comments

Comments
 (0)