Skip to content

Commit

Permalink
Closes #624
Browse files Browse the repository at this point in the history
Replaced sycl::context::get() with
sycl::get_native<sycl::backend::opencl>( context )

Similar change for level-zero.
  • Loading branch information
oleksandr-pavlyk committed Oct 12, 2021
1 parent 49ded41 commit 4cd923c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dpctl-capi/source/dpctl_sycl_program_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ createOpenCLInterOpProgram(const context &SyclCtx,
const char *CompileOpts)
{
cl_int err;
auto CLCtx = SyclCtx.get();
auto CLCtx = get_native<backend::opencl>(SyclCtx);
auto CLProgram = clCreateProgramWithIL(CLCtx, IL, length, &err);
if (err) {
// \todo: record the error string and any other information.
Expand All @@ -89,7 +89,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<backend::opencl>(SyclDevices[i]);

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

auto ZeDevice = SyclDevices[0].get_native<backend::level_zero>();
auto ZeDevice = get_native<backend::level_zero>(SyclDevices[0]);
ze_module_handle_t ZeModule;

auto stZeModuleCreateF = getZeModuleCreateFn();
Expand Down

0 comments on commit 4cd923c

Please sign in to comment.