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

[SYCL][ESIMD] Bugfix & single_task for fmod_compatibility test #1243

Merged
merged 1 commit into from
Sep 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions SYCL/ESIMD/regression/fmod_compatibility_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,28 @@ int test_fmod(float x, float y) {
sycl::buffer<float, 1> vector_buffer(out.data(), out.size());
sycl::buffer<float, 1> scalar_buffer(&scalar_result, sycl::range<1>(1));

sycl::nd_range<1> nd{sycl::range<1>(1), sycl::range<1>(1)};

auto e = queue.submit([&](sycl::handler &cgh) {
sycl::accessor<float, 1, sycl_write> vector_out =
vector_buffer.get_access<sycl_write>(cgh);
sycl::accessor<float, 1, sycl_write> scalar_out =
scalar_buffer.get_access<sycl_write>(cgh);

auto kernel = ([=](sycl::item<1> item) [[intel::sycl_explicit_simd]] {
auto kernel = ([=]() [[intel::sycl_explicit_simd]] {
using namespace sycl::ext::intel::esimd;

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

simd<float, SIMD> vector_result =
sycl::ext::intel::experimental::esimd::fmod(a, b);
simd<float, SIMD> scalar_result =
simd<float, 1> scalar_result =
sycl::ext::intel::experimental::esimd::fmod(ha, hb);

vector_result.copy_to(vector_out, 0);
scalar_result.copy_to(scalar_out, 0);
});

cgh.parallel_for<class Reduction>(nd, kernel);
cgh.single_task<class Reduction>(kernel);
});
queue.wait();
}
Expand Down