Skip to content

Commit 5574bc3

Browse files
Closes #624
Replaced sycl::context::get() with sycl::get_native<sycl::backend::opencl>( context ) Similar change for level-zero.
1 parent 49ded41 commit 5574bc3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

dpctl-capi/source/dpctl_sycl_program_interface.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "Support/CBindingWrapping.h"
3030
#include <CL/cl.h> /* OpenCL headers */
3131
#include <CL/sycl.hpp> /* Sycl headers */
32+
#include <CL/sycl/backend/opencl.hpp>
3233

3334
#ifdef DPCTL_ENABLE_LO_PROGRAM_CREATION
3435
#include "../helper/include/dpctl_dynamic_lib_helper.h"
@@ -75,7 +76,7 @@ createOpenCLInterOpProgram(const context &SyclCtx,
7576
const char *CompileOpts)
7677
{
7778
cl_int err;
78-
auto CLCtx = SyclCtx.get();
79+
auto CLCtx = get_native<backend::opencl>(SyclCtx);
7980
auto CLProgram = clCreateProgramWithIL(CLCtx, IL, length, &err);
8081
if (err) {
8182
// \todo: record the error string and any other information.
@@ -89,7 +90,7 @@ createOpenCLInterOpProgram(const context &SyclCtx,
8990
// Get a list of CL Devices from the Sycl devices
9091
auto CLDevices = new cl_device_id[SyclDevices.size()];
9192
for (auto i = 0ul; i < SyclDevices.size(); ++i)
92-
CLDevices[i] = SyclDevices[i].get();
93+
CLDevices[i] = get_native<backend::opencl>(SyclDevices[i]);
9394

9495
// Build the OpenCL interoperability program
9596
err = clBuildProgram(CLProgram, (cl_uint)(SyclDevices.size()), CLDevices,
@@ -138,7 +139,7 @@ createLevelZeroInterOpProgram(const context &SyclCtx,
138139
size_t length,
139140
const char *CompileOpts)
140141
{
141-
auto ZeCtx = SyclCtx.get_native<backend::level_zero>();
142+
auto ZeCtx = get_native<backend::level_zero>(SyclCtx);
142143
auto SyclDevices = SyclCtx.get_devices();
143144
if (SyclDevices.size() > 1) {
144145
std::cerr << "Level zero program can be created for only one device.\n";
@@ -159,7 +160,7 @@ createLevelZeroInterOpProgram(const context &SyclCtx,
159160
ZeModuleDesc.pBuildFlags = CompileOpts;
160161
ZeModuleDesc.pConstants = &ZeSpecConstants;
161162

162-
auto ZeDevice = SyclDevices[0].get_native<backend::level_zero>();
163+
auto ZeDevice = get_native<backend::level_zero>(SyclDevices[0]);
163164
ze_module_handle_t ZeModule;
164165

165166
auto stZeModuleCreateF = getZeModuleCreateFn();

0 commit comments

Comments
 (0)