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

Commit 5dc16c8

Browse files
authored
[SYCL][ESIMD] Add tests for new raw send{s} API (#1664)
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 4dd294a commit 5dc16c8

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

SYCL/ESIMD/histogram_raw_send.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
// REQUIRES: gpu-intel-gen9
1010
// UNSUPPORTED: gpu-intel-dg1,gpu-intel-dg2,cuda,hip, gpu-intel-pvc
1111
// UNSUPPORTED: ze_debug-1,ze_debug4
12-
// RUN: %clangxx -fsycl %s -o %t.out
13-
// RUN: %GPU_RUN_PLACEHOLDER %t.out
12+
// RUN: %clangxx -fsycl %s -o %t1.out
13+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
14+
// RUN: %clangxx -fsycl -DNEW_API %s -o %t2.out
15+
// RUN: %GPU_RUN_PLACEHOLDER %t2.out
1416

1517
// The test checks raw send functionality with atomic write implementation
1618
// on SKL. It does not work on DG1 due to send instruction incompatibility.
@@ -85,10 +87,15 @@ ESIMD_INLINE void atomic_write(T *bins, simd<unsigned, n> offset,
8587
constexpr uint8_t numSrc1 = 0x1;
8688
constexpr uint8_t isEOT = 0;
8789
constexpr uint8_t isSendc = 0;
88-
90+
#ifdef NEW_API
91+
experimental::esimd::raw_sends(oldDst, vAddr, src0, exDesc, desc, execSize,
92+
sfid, numSrc0, numSrc1, numDst, isEOT, isSendc,
93+
pred);
94+
#else
8995
experimental::esimd::raw_sends_load(oldDst, vAddr, src0, exDesc, desc,
9096
execSize, sfid, numSrc0, numSrc1, numDst,
9197
isEOT, isSendc, pred);
98+
#endif
9299
}
93100

94101
int main(int argc, char *argv[]) {

SYCL/ESIMD/vadd_raw_send.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
// UNSUPPORTED: gpu-intel-dg1,gpu-intel-dg2,cuda,hip
1111
// TODO: esimd_emulator fails due to unimplemented 'raw_send' intrinsic
1212
// XFAIL: esimd_emulator
13-
// RUN: %clangxx -fsycl %s -o %t.out
14-
// RUN: %GPU_RUN_PLACEHOLDER %t.out
13+
// RUN: %clangxx -fsycl %s -o %t1.out
14+
// RUN: %GPU_RUN_PLACEHOLDER %t1.out
15+
// RUN: %clangxx -fsycl -DNEW_API %s -o %t2.out
16+
// RUN: %GPU_RUN_PLACEHOLDER %t2.out
1517

1618
// The test checks raw send functionality with block read/write implementation
1719
// on SKL. It does not work on DG1 due to send instruction incompatibility.
@@ -41,9 +43,13 @@ ESIMD_INLINE simd<T, N> dwaligned_block_read(AccessorTy acc,
4143
constexpr uint8_t sfid = 0x0;
4244
constexpr uint8_t numSrc0 = 0x1;
4345
constexpr uint8_t numDst = 0x2;
44-
46+
#ifdef NEW_API
47+
return experimental::esimd::raw_send(oldDst, src0, exDesc, desc, execSize,
48+
sfid, numSrc0, numDst);
49+
#else
4550
return experimental::esimd::raw_send_load(oldDst, src0, exDesc, desc,
4651
execSize, sfid, numSrc0, numDst);
52+
#endif
4753
}
4854

4955
template <typename T, int N, typename AccessorTy>
@@ -59,9 +65,13 @@ ESIMD_INLINE void block_write1(AccessorTy acc, unsigned int offset,
5965
constexpr uint8_t sfid = 0x0;
6066
constexpr uint8_t numSrc0 = 0x1;
6167
constexpr uint8_t numSrc1 = 0x1;
62-
68+
#ifdef NEW_API
69+
return experimental::esimd::raw_sends(src0, data, exDesc, desc, execSize,
70+
sfid, numSrc0, numSrc1);
71+
#else
6372
return experimental::esimd::raw_sends_store(src0, data, exDesc, desc,
6473
execSize, sfid, numSrc0, numSrc1);
74+
#endif
6575
}
6676

6777
template <typename T, int N, typename AccessorTy>
@@ -80,9 +90,13 @@ ESIMD_INLINE void block_write2(AccessorTy acc, unsigned int offset,
8090
constexpr uint8_t execSize = 0x83;
8191
constexpr uint8_t sfid = 0x0;
8292
constexpr uint8_t numSrc0 = 0x2;
83-
93+
#ifdef NEW_API
94+
return experimental::esimd::raw_send(src0, exDesc, desc, execSize, sfid,
95+
numSrc0);
96+
#else
8497
return experimental::esimd::raw_send_store(src0, exDesc, desc, execSize, sfid,
8598
numSrc0);
99+
#endif
86100
}
87101

88102
int main(void) {

0 commit comments

Comments
 (0)