From 67afcec6026ce2423de4f9e0ed167c3dc8396cac Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Tue, 12 Oct 2021 05:44:27 -0500 Subject: [PATCH] Closes #624 Replaced sycl::context::get() with sycl::get_native( context ) Similar change for level-zero. --- dpctl-capi/source/dpctl_sycl_program_interface.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dpctl-capi/source/dpctl_sycl_program_interface.cpp b/dpctl-capi/source/dpctl_sycl_program_interface.cpp index bab97b4d81..78945e6aea 100644 --- a/dpctl-capi/source/dpctl_sycl_program_interface.cpp +++ b/dpctl-capi/source/dpctl_sycl_program_interface.cpp @@ -29,6 +29,7 @@ #include "Support/CBindingWrapping.h" #include /* OpenCL headers */ #include /* Sycl headers */ +#include #ifdef DPCTL_ENABLE_LO_PROGRAM_CREATION #include "../helper/include/dpctl_dynamic_lib_helper.h" @@ -75,7 +76,7 @@ createOpenCLInterOpProgram(const context &SyclCtx, const char *CompileOpts) { cl_int err; - auto CLCtx = SyclCtx.get(); + auto CLCtx = get_native(SyclCtx); auto CLProgram = clCreateProgramWithIL(CLCtx, IL, length, &err); if (err) { // \todo: record the error string and any other information. @@ -89,7 +90,7 @@ createOpenCLInterOpProgram(const context &SyclCtx, // Get a list of CL Devices from the Sycl devices auto CLDevices = new cl_device_id[SyclDevices.size()]; for (auto i = 0ul; i < SyclDevices.size(); ++i) - CLDevices[i] = SyclDevices[i].get(); + CLDevices[i] = get_native(SyclDevices[i]); // Build the OpenCL interoperability program err = clBuildProgram(CLProgram, (cl_uint)(SyclDevices.size()), CLDevices, @@ -138,7 +139,7 @@ createLevelZeroInterOpProgram(const context &SyclCtx, size_t length, const char *CompileOpts) { - auto ZeCtx = SyclCtx.get_native(); + auto ZeCtx = get_native(SyclCtx); auto SyclDevices = SyclCtx.get_devices(); if (SyclDevices.size() > 1) { std::cerr << "Level zero program can be created for only one device.\n"; @@ -159,7 +160,7 @@ createLevelZeroInterOpProgram(const context &SyclCtx, ZeModuleDesc.pBuildFlags = CompileOpts; ZeModuleDesc.pConstants = &ZeSpecConstants; - auto ZeDevice = SyclDevices[0].get_native(); + auto ZeDevice = get_native(SyclDevices[0]); ze_module_handle_t ZeModule; auto stZeModuleCreateF = getZeModuleCreateFn();