Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement tests for sycl_ext_oneapi_kernel_compiler_spirv extension #868

Merged
merged 10 commits into from
Mar 30, 2024
6 changes: 3 additions & 3 deletions tests/extension/oneapi_kernel_compiler_spirv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
if(SYCL_CTS_ENABLE_EXT_ONEAPI_KERNEL_COMPILER_SPIRV_TESTS)
file(GLOB test_cases_list *.cpp)

file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/kernels.spv" KERNELS_PATH)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fp16.spv" KERNELS_FP16_PATH)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fp64.spv" KERNELS_FP64_PATH)
file(TO_CMAKE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/kernels.spv" KERNELS_PATH)
file(TO_CMAKE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fp16.spv" KERNELS_FP16_PATH)
file(TO_CMAKE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fp64.spv" KERNELS_FP64_PATH)
add_compile_definitions(KERNELS_PATH="${KERNELS_PATH}")
add_compile_definitions(KERNELS_FP16_PATH="${KERNELS_FP16_PATH}")
add_compile_definitions(KERNELS_FP64_PATH="${KERNELS_FP64_PATH}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*******************************************************************************/

#include "../../common/common.h"
#include <exception.hpp>

namespace kernel_compiler_spirv::tests {

Expand Down Expand Up @@ -63,8 +62,9 @@ void testSimpleKernel(sycl::queue& q, const sycl::kernel& kernel,
sycl::buffer<int> output_buffer{sycl::range<1>(N)};

q.submit([&](sycl::handler& cgh) {
cgh.set_args(input_buffer.get_access<sycl::access::mode::read>(cgh),
output_buffer.get_access<sycl::access::mode::write>(cgh));
cgh.set_args(
sycl::accessor<int, 1, sycl::access_mode::read>{input_buffer, cgh},
sycl::accessor<int, 1, sycl::access_mode::write>{output_buffer, cgh});
0x12CC marked this conversation as resolved.
Show resolved Hide resolved
cgh.parallel_for(sycl::range<1>{N}, kernel);
});

Expand Down Expand Up @@ -116,7 +116,7 @@ void testParam(sycl::queue& q, const sycl::kernel& kernel) {
cgh.set_arg(1, b_ptr);
// Pass sycl::accessor for OpTypePointer(CrossWorkgroup) parameter.
cgh.set_arg(
2, output_buffer.template get_access<sycl::access::mode::write>(cgh));
2, sycl::accessor<T, 1, sycl::access_mode::write>{output_buffer, cgh});
0x12CC marked this conversation as resolved.
Show resolved Hide resolved
// Pass sycl::local_accessor for OpTypePointer(Workgroup) parameter.
cgh.set_arg(3, local);
0x12CC marked this conversation as resolved.
Show resolved Hide resolved
cgh.parallel_for(sycl::range<1>{1}, kernel);
Expand Down
Loading