29
29
#include " Support/CBindingWrapping.h"
30
30
#include < CL/cl.h> /* OpenCL headers */
31
31
#include < CL/sycl.hpp> /* Sycl headers */
32
+ #include < CL/sycl/backend/opencl.hpp>
32
33
33
34
#ifdef DPCTL_ENABLE_LO_PROGRAM_CREATION
34
35
#include " ../helper/include/dpctl_dynamic_lib_helper.h"
@@ -75,7 +76,7 @@ createOpenCLInterOpProgram(const context &SyclCtx,
75
76
const char *CompileOpts)
76
77
{
77
78
cl_int err;
78
- auto CLCtx = SyclCtx. get ( );
79
+ auto CLCtx = get_native<backend::opencl>(SyclCtx );
79
80
auto CLProgram = clCreateProgramWithIL (CLCtx, IL, length, &err);
80
81
if (err) {
81
82
// \todo: record the error string and any other information.
@@ -89,7 +90,7 @@ createOpenCLInterOpProgram(const context &SyclCtx,
89
90
// Get a list of CL Devices from the Sycl devices
90
91
auto CLDevices = new cl_device_id[SyclDevices.size ()];
91
92
for (auto i = 0ul ; i < SyclDevices.size (); ++i)
92
- CLDevices[i] = SyclDevices[i]. get ( );
93
+ CLDevices[i] = get_native<backend::opencl>( SyclDevices[i]);
93
94
94
95
// Build the OpenCL interoperability program
95
96
err = clBuildProgram (CLProgram, (cl_uint)(SyclDevices.size ()), CLDevices,
@@ -138,7 +139,7 @@ createLevelZeroInterOpProgram(const context &SyclCtx,
138
139
size_t length,
139
140
const char *CompileOpts)
140
141
{
141
- auto ZeCtx = SyclCtx. get_native <backend::level_zero>();
142
+ auto ZeCtx = get_native<backend::level_zero>(SyclCtx );
142
143
auto SyclDevices = SyclCtx.get_devices ();
143
144
if (SyclDevices.size () > 1 ) {
144
145
std::cerr << " Level zero program can be created for only one device.\n " ;
@@ -159,7 +160,7 @@ createLevelZeroInterOpProgram(const context &SyclCtx,
159
160
ZeModuleDesc.pBuildFlags = CompileOpts;
160
161
ZeModuleDesc.pConstants = &ZeSpecConstants;
161
162
162
- auto ZeDevice = SyclDevices[ 0 ]. get_native <backend::level_zero>();
163
+ auto ZeDevice = get_native<backend::level_zero>(SyclDevices[ 0 ] );
163
164
ze_module_handle_t ZeModule;
164
165
165
166
auto stZeModuleCreateF = getZeModuleCreateFn ();
0 commit comments