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

[SYCL] Change online compiler test to build IL based on queue #1028

Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions SYCL/OnlineCompiler/online_compiler_L0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
using byte = unsigned char;

#ifdef RUN_KERNELS
sycl::kernel getSYCLKernelWithIL(sycl::context &Context,
sycl::kernel getSYCLKernelWithIL(sycl::queue &Queue,
const std::vector<byte> &IL) {

ze_module_desc_t ZeModuleDesc = {};
Expand All @@ -33,8 +33,8 @@ sycl::kernel getSYCLKernelWithIL(sycl::context &Context,
ZeModuleDesc.pBuildFlags = "";
ZeModuleDesc.pConstants = nullptr;

assert(Context.get_devices().size() == 1 && "Expected to have only 1 device");
sycl::device Device = Context.get_devices()[0];
sycl::context Context = Queue.get_context();
sycl::device Device = Queue.get_device();
auto ZeDevice = Device.get_native<sycl::backend::ext_oneapi_level_zero>();
auto ZeContext = Context.get_native<sycl::backend::ext_oneapi_level_zero>();

Expand Down
4 changes: 3 additions & 1 deletion SYCL/OnlineCompiler/online_compiler_OpenCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
using byte = unsigned char;

#ifdef RUN_KERNELS
sycl::kernel getSYCLKernelWithIL(sycl::context &Context,
sycl::kernel getSYCLKernelWithIL(sycl::queue &Queue,
const std::vector<byte> &IL) {
sycl::context Context = Queue.get_context();

cl_int Err;
cl_program ClProgram =
clCreateProgramWithIL(sycl::get_native<sycl::backend::opencl>(Context),
Expand Down
5 changes: 2 additions & 3 deletions SYCL/OnlineCompiler/online_compiler_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ void testSyclKernel(sycl::queue &Q, sycl::kernel Kernel) {

int main(int argc, char **argv) {
cl::sycl::queue Q;
cl::sycl::context Context = Q.get_context();
cl::sycl::device Device = Q.get_device();

{ // Compile and run a trivial OpenCL kernel.
Expand All @@ -73,7 +72,7 @@ int main(int argc, char **argv) {
return 1;
}
#ifdef RUN_KERNELS
testSyclKernel(Q, getSYCLKernelWithIL(Context, IL));
testSyclKernel(Q, getSYCLKernelWithIL(Q, IL));
#endif // RUN_KERNELS
}

Expand All @@ -93,7 +92,7 @@ int main(int argc, char **argv) {
return 1;
}
#ifdef RUN_KERNELS
testSyclKernel(Q, getSYCLKernelWithIL(Context, IL));
testSyclKernel(Q, getSYCLKernelWithIL(Q, IL));
#endif // RUN_KERNELS
}

Expand Down