Skip to content

Commit 8c0e488

Browse files
authored
[SYCL][ESIMD]Add tests for 8/16 bit data for lsc_slm_block_load and lsc_slm_block_store API (#12416)
1 parent d4f4f7c commit 8c0e488

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

sycl/test-e2e/ESIMD/lsc/Inputs/lsc_slm_load.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ bool test(queue Q, uint32_t PMask = ~0) {
2323
}
2424

2525
static_assert(DS != lsc_data_size::u16u32h, "D16U32h not supported in HW");
26-
static_assert(sizeof(T) >= 4,
27-
"D8 and D16 are valid only in 2D block load/store");
2826

2927
if constexpr (!Transpose && NChannels > 1) {
3028
static_assert(VL == 16 || VL == 32,
@@ -99,7 +97,7 @@ bool test(queue Q, uint32_t PMask = ~0) {
9997

10098
simd<T, VL * NChannels> Vals;
10199
if constexpr (TestMergeOperand) {
102-
simd<T, VL *NChannels> OldVals = MergeValue;
100+
simd<T, VL * NChannels> OldVals = MergeValue;
103101
Vals = lsc_slm_gather<T, NChannels, DS>(Offsets, Pred, OldVals);
104102
} else {
105103
Vals = lsc_slm_gather<T, NChannels, DS>(Offsets, Pred);

sycl/test-e2e/ESIMD/lsc/Inputs/lsc_slm_store.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ bool test(uint32_t PMask = ~0) {
1919
}
2020

2121
static_assert(DS != lsc_data_size::u16u32h, "D16U32h not supported in HW");
22-
static_assert(sizeof(T) >= 4,
23-
"D8 and D16 are valid only in 2D block load/store");
2422

2523
if constexpr (!Transpose && NChannels > 1) {
2624
static_assert(VL == 16 || VL == 32,

sycl/test-e2e/ESIMD/lsc/lsc_slm_block_load.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,17 @@ int main() {
3636
Passed &= test_load<uint32_t, TestMerging>(Q);
3737
Passed &= test_load<uint64_t, TestMerging>(Q);
3838

39-
// TODO: Enable the test with 1- and 2-byte element types, with floating point
40-
// types when lsc_slm_block_load() API is ready.
39+
Passed &= test_load<uint16_t, !TestMerging>(Q);
40+
Passed &= test_load<uint8_t, !TestMerging>(Q);
41+
42+
Passed &= test_load<uint16_t, TestMerging>(Q);
43+
Passed &= test_load<uint8_t, TestMerging>(Q);
44+
45+
Passed &= test_load<float, !TestMerging>(Q);
46+
Passed &= test_load<double, !TestMerging>(Q);
47+
48+
Passed &= test_load<float, TestMerging>(Q);
49+
Passed &= test_load<double, TestMerging>(Q);
4150

4251
std::cout << (Passed ? "Passed" : "FAILED") << std::endl;
4352
return Passed ? 0 : 1;

sycl/test-e2e/ESIMD/lsc/lsc_slm_block_store.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ template <int Id, int NGroups, int LocalSize, int VL> bool test_store() {
1717
bool Passed = true;
1818
Passed &= test<Id, uint32_t, NGroups, LocalSize, VL, 1, true>();
1919
Passed &= test<Id + 1, uint64_t, NGroups, LocalSize, VL, 1, true>();
20+
Passed &= test<Id + 2, uint16_t, NGroups, LocalSize, VL, 1, true>();
21+
if constexpr (VL >= 4) {
22+
Passed &= test<Id + 3, uint8_t, NGroups, LocalSize, VL, 1, true>();
23+
}
2024
return Passed;
2125
}
2226

@@ -25,11 +29,11 @@ int main(void) {
2529

2630
// test_store<Id, NGroups, LocalSize, VL>();
2731
Passed &= test_store<0, 1, 1, 4>();
28-
Passed &= test_store<2, 1, 7, 16>();
29-
Passed &= test_store<4, 4, 3, 2>();
30-
Passed &= test_store<6, 16, 8, 8>();
31-
Passed &= test_store<8, 2, 4, 32>();
32-
Passed &= test_store<10, 2, 4, 64>();
32+
Passed &= test_store<4, 1, 7, 16>();
33+
Passed &= test_store<8, 4, 3, 2>();
34+
Passed &= test_store<12, 16, 8, 8>();
35+
Passed &= test_store<16, 2, 4, 32>();
36+
Passed &= test_store<20, 2, 4, 64>();
3337

3438
std::cout << (Passed ? "Passed" : "FAILED") << std::endl;
3539
return Passed ? 0 : 1;

0 commit comments

Comments
 (0)