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

Commit 7295f7e

Browse files
sndmitrievkbobrovs
andauthored
[SYCL][ESIMD] Update tests after API changes (#974)
* [SYCL][ESIMD] Update tests after API changes Some arguments have been changes to template parameters to force them to be compile-time constants which is required by low-level intrinsics. Signed-off-by: Sergey Dmitriev <[email protected]> Co-authored-by: kbobrovs <[email protected]>
1 parent ff6000d commit 7295f7e

8 files changed

+18
-18
lines changed

SYCL/ESIMD/api/slm_gather_scatter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ template <typename T, unsigned VL, unsigned STRIDE> struct Kernel {
2121
using namespace sycl::ext::intel::esimd;
2222

2323
// In this test, we have a single workitem. No barriers required.
24-
slm_init(
25-
VL * STRIDE *
26-
sizeof(typename sycl::ext::intel::esimd::detail::dword_type<T>::type));
24+
slm_init<VL * STRIDE *
25+
sizeof(typename sycl::ext::intel::esimd::detail::dword_type<
26+
T>::type)>();
2727

2828
simd<T, VL> valsIn;
2929
valsIn.copy_from(buf);

SYCL/ESIMD/api/slm_gather_scatter_heavy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ struct GatherKernel : KernelBase<T, VL, STRIDE> {
111111
static const char *get_name() { return "slm_gather"; }
112112

113113
void operator()(nd_item<1> i) const SYCL_ESIMD_KERNEL {
114-
slm_init(B::SLM_CHUNK_SIZE);
114+
slm_init<B::SLM_CHUNK_SIZE>();
115115

116116
// first, read data w/o shuffling into SLM
117117
simd<T, VL> val;
@@ -174,7 +174,7 @@ struct ScatterKernel : KernelBase<T, VL, STRIDE> {
174174
static const char *get_name() { return "slm_scatter"; }
175175

176176
ESIMD_INLINE void operator()(nd_item<1> i) const SYCL_ESIMD_KERNEL {
177-
slm_init(B::SLM_CHUNK_SIZE);
177+
slm_init<B::SLM_CHUNK_SIZE>();
178178

179179
// first, read data from memory into registers w/o shuffling
180180
simd<T, VL> val;
@@ -242,7 +242,7 @@ struct GatherKernel<T, 1, STRIDE, TEST_VECTOR_NO_MASK>
242242
static const char *get_name() { return "slm_gather_vl1"; }
243243

244244
void operator()(nd_item<1> i) const SYCL_ESIMD_KERNEL {
245-
slm_init(B::SLM_CHUNK_SIZE);
245+
slm_init<B::SLM_CHUNK_SIZE>();
246246

247247
// first, read data into SLM
248248
T val = scalar_load<T>(B::acc_in, B::get_wi_offset(i) * sizeof(T));
@@ -268,7 +268,7 @@ struct ScatterKernel<T, 1, STRIDE, TEST_VECTOR_NO_MASK>
268268
static const char *get_name() { return "slm_scatter_vl1"; }
269269

270270
ESIMD_INLINE void operator()(nd_item<1> i) const SYCL_ESIMD_KERNEL {
271-
slm_init(B::SLM_CHUNK_SIZE);
271+
slm_init<B::SLM_CHUNK_SIZE>();
272272

273273
// first, read data from memory into registers
274274
simd<T, 1> val;

SYCL/ESIMD/api/slm_gather_scatter_rgba.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ template <typename T, unsigned VL, auto CH_MASK> struct Kernel {
3232
// In this test, each group consist of one workitem. No barriers required.
3333
// Each workitem accesses contiguous block of VL elements, where
3434
// each element consists of RGBA channels.
35-
slm_init(VL * NUM_RGBA_CHANNELS * sizeof(T));
35+
slm_init<VL * NUM_RGBA_CHANNELS * sizeof(T)>();
3636

3737
// Prepare initial values in SLM:
3838
// 0, -1, -2, -3, -4 ...

SYCL/ESIMD/histogram_256_slm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
3030
uint32_t gid, uint32_t lid,
3131
uint32_t local_size) {
3232
// Declare and initialize SLM
33-
slm_init(SLM_SIZE);
33+
slm_init<SLM_SIZE>();
3434
uint linear_id = gid * local_size + lid;
3535

3636
simd<uint, 16> slm_offset(0, 1);

SYCL/ESIMD/histogram_256_slm_spec_2020.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ESIMD_INLINE void histogram_atomic(const uint32_t *input_ptr, uint32_t *output,
2828
uint32_t gid, uint32_t lid,
2929
uint32_t local_size, uint32_t num_blocks) {
3030
// Declare and initialize SLM
31-
slm_init(SLM_SIZE);
31+
slm_init<SLM_SIZE>();
3232
uint linear_id = gid * local_size + lid;
3333

3434
simd<uint, 16> slm_offset(0, 1);

SYCL/ESIMD/lsc/lsc_slm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int main() {
6060
auto compare = simd<int, SIMDSize>(id * SIMDSize, 1);
6161
auto swap = compare * 2;
6262

63-
slm_init(4096);
63+
slm_init<4096>();
6464
lsc_slm_block_store<int, SIMDSize>(offset, data * 2);
6565
auto data_0 = lsc_slm_block_load<int, SIMDSize>(offset);
6666
lsc_block_store<int, SIMDSize>(access_0, offset, data_0);

SYCL/ESIMD/slm_barrier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ int main(void) {
112112
uint globalID = ndi.get_global_id(0);
113113
uint groupID = ndi.get_group(0);
114114

115-
slm_init(1024);
115+
slm_init<1024>();
116116

117117
int grpMemOffset = groupID * groupSize * VL * 4;
118118

SYCL/ESIMD/slm_split_barrier.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using namespace cl::sycl;
2020
using namespace sycl::ext::intel;
2121
using namespace sycl::ext::intel::esimd;
22+
using namespace sycl::ext::intel::experimental::esimd;
2223

2324
#define LOCAL_SIZE 4
2425
#define GLOBAL_SIZE 6
@@ -68,11 +69,10 @@ void load_to_slm(uint grpSize, uint localId, uint slmOffset, char *addr,
6869
vOffsets += (grpSize * 256);
6970
}
7071

71-
esimd::fence(fence_mask::global_coherent_fence);
72-
experimental::esimd::split_barrier(
73-
experimental::esimd::split_barrier_action::signal);
74-
experimental::esimd::split_barrier(
75-
experimental::esimd::split_barrier_action::wait);
72+
// add memory fence and split barriers
73+
fence<fence_mask::global_coherent_fence>();
74+
split_barrier<split_barrier_action::signal>();
75+
split_barrier<split_barrier_action::wait>();
7676
}
7777

7878
int main(void) {
@@ -115,7 +115,7 @@ int main(void) {
115115
uint globalID = ndi.get_global_id(0);
116116
uint groupID = ndi.get_group(0);
117117

118-
slm_init(1024);
118+
slm_init<1024>();
119119

120120
int grpMemOffset = groupID * groupSize * VL * 4;
121121

0 commit comments

Comments
 (0)