Skip to content

Commit 4cd923c

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 4cd923c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dpctl-capi/source/dpctl_sycl_program_interface.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ createOpenCLInterOpProgram(const context &SyclCtx,
7575
const char *CompileOpts)
7676
{
7777
cl_int err;
78-
auto CLCtx = SyclCtx.get();
78+
auto CLCtx = get_native<backend::opencl>(SyclCtx);
7979
auto CLProgram = clCreateProgramWithIL(CLCtx, IL, length, &err);
8080
if (err) {
8181
// \todo: record the error string and any other information.
@@ -89,7 +89,7 @@ createOpenCLInterOpProgram(const context &SyclCtx,
8989
// Get a list of CL Devices from the Sycl devices
9090
auto CLDevices = new cl_device_id[SyclDevices.size()];
9191
for (auto i = 0ul; i < SyclDevices.size(); ++i)
92-
CLDevices[i] = SyclDevices[i].get();
92+
CLDevices[i] = get_native<backend::opencl>(SyclDevices[i]);
9393

9494
// Build the OpenCL interoperability program
9595
err = clBuildProgram(CLProgram, (cl_uint)(SyclDevices.size()), CLDevices,
@@ -138,7 +138,7 @@ createLevelZeroInterOpProgram(const context &SyclCtx,
138138
size_t length,
139139
const char *CompileOpts)
140140
{
141-
auto ZeCtx = SyclCtx.get_native<backend::level_zero>();
141+
auto ZeCtx = get_native<backend::level_zero>(SyclCtx);
142142
auto SyclDevices = SyclCtx.get_devices();
143143
if (SyclDevices.size() > 1) {
144144
std::cerr << "Level zero program can be created for only one device.\n";
@@ -159,7 +159,7 @@ createLevelZeroInterOpProgram(const context &SyclCtx,
159159
ZeModuleDesc.pBuildFlags = CompileOpts;
160160
ZeModuleDesc.pConstants = &ZeSpecConstants;
161161

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

165165
auto stZeModuleCreateF = getZeModuleCreateFn();

0 commit comments

Comments
 (0)