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

Commit 735d633

Browse files
[SYCL][ESIMD] Bugfix & single_task for fmod_compatibility test (#1243)
- Bug fix for 'scalar_result' - Replacing 'parallel_for' with 'single_task' for simplified test
1 parent 6d3dd9d commit 735d633

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

SYCL/ESIMD/regression/fmod_compatibility_test.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,28 @@ int test_fmod(float x, float y) {
3636
sycl::buffer<float, 1> vector_buffer(out.data(), out.size());
3737
sycl::buffer<float, 1> scalar_buffer(&scalar_result, sycl::range<1>(1));
3838

39-
sycl::nd_range<1> nd{sycl::range<1>(1), sycl::range<1>(1)};
40-
4139
auto e = queue.submit([&](sycl::handler &cgh) {
4240
sycl::accessor<float, 1, sycl_write> vector_out =
4341
vector_buffer.get_access<sycl_write>(cgh);
4442
sycl::accessor<float, 1, sycl_write> scalar_out =
4543
scalar_buffer.get_access<sycl_write>(cgh);
4644

47-
auto kernel = ([=](sycl::item<1> item) [[intel::sycl_explicit_simd]] {
45+
auto kernel = ([=]() [[intel::sycl_explicit_simd]] {
4846
using namespace sycl::ext::intel::esimd;
4947

5048
simd<float, SIMD> a = ha;
5149
simd<float, SIMD> b = hb;
5250

5351
simd<float, SIMD> vector_result =
5452
sycl::ext::intel::experimental::esimd::fmod(a, b);
55-
simd<float, SIMD> scalar_result =
53+
simd<float, 1> scalar_result =
5654
sycl::ext::intel::experimental::esimd::fmod(ha, hb);
5755

5856
vector_result.copy_to(vector_out, 0);
5957
scalar_result.copy_to(scalar_out, 0);
6058
});
6159

62-
cgh.parallel_for<class Reduction>(nd, kernel);
60+
cgh.single_task<class Reduction>(kernel);
6361
});
6462
queue.wait();
6563
}

0 commit comments

Comments
 (0)