@@ -27,7 +27,7 @@ namespace usm {
27
27
USMDispatcher::USMDispatcher (cl_platform_id platform) {
28
28
// TODO: update when platform_impl becomes more PI aware
29
29
30
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
30
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
31
31
GET_EXTENSION (clHostMemAllocINTEL);
32
32
GET_EXTENSION (clDeviceMemAllocINTEL);
33
33
GET_EXTENSION (clSharedMemAllocINTEL);
@@ -53,15 +53,15 @@ void *USMDispatcher::hostMemAlloc(pi_context Context,
53
53
pi_result *ErrcodeRet) {
54
54
void *RetVal = nullptr ;
55
55
56
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
57
- cl_context CLContext = pi::pi_cast <cl_context>(Context);
56
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
57
+ cl_context CLContext = pi::cast <cl_context>(Context);
58
58
59
59
if (mEmulated ) {
60
60
RetVal = mEmulator ->hostMemAlloc (CLContext, Properties, Size, Alignment,
61
- pi::pi_cast <cl_int *>(ErrcodeRet));
61
+ pi::cast <cl_int *>(ErrcodeRet));
62
62
} else {
63
63
RetVal = pfn_clHostMemAllocINTEL (CLContext, Properties, Size, Alignment,
64
- pi::pi_cast <cl_int *>(ErrcodeRet));
64
+ pi::cast <cl_int *>(ErrcodeRet));
65
65
}
66
66
}
67
67
@@ -77,18 +77,18 @@ void *USMDispatcher::deviceMemAlloc(pi_context Context, pi_device Device,
77
77
pi_result *ErrcodeRet) {
78
78
void *RetVal = nullptr ;
79
79
80
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
81
- cl_context CLContext = pi::pi_cast <cl_context>(Context);
82
- cl_device_id CLDevice = pi::pi_cast <cl_device_id>(Device);
80
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
81
+ cl_context CLContext = pi::cast <cl_context>(Context);
82
+ cl_device_id CLDevice = pi::cast <cl_device_id>(Device);
83
83
84
84
if (mEmulated ) {
85
85
RetVal = mEmulator ->deviceMemAlloc (CLContext, CLDevice, Properties, Size,
86
86
Alignment,
87
- pi::pi_cast <cl_int *>(ErrcodeRet));
87
+ pi::cast <cl_int *>(ErrcodeRet));
88
88
} else {
89
89
RetVal = pfn_clDeviceMemAllocINTEL (CLContext, CLDevice, Properties, Size,
90
90
Alignment,
91
- pi::pi_cast <cl_int *>(ErrcodeRet));
91
+ pi::cast <cl_int *>(ErrcodeRet));
92
92
}
93
93
}
94
94
@@ -104,18 +104,18 @@ void *USMDispatcher::sharedMemAlloc(pi_context Context, pi_device Device,
104
104
pi_result *ErrcodeRet) {
105
105
void *RetVal = nullptr ;
106
106
107
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
108
- cl_context CLContext = pi::pi_cast <cl_context>(Context);
109
- cl_device_id CLDevice = pi::pi_cast <cl_device_id>(Device);
107
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
108
+ cl_context CLContext = pi::cast <cl_context>(Context);
109
+ cl_device_id CLDevice = pi::cast <cl_device_id>(Device);
110
110
111
111
if (mEmulated ) {
112
112
RetVal = mEmulator ->sharedMemAlloc (CLContext, CLDevice, Properties, Size,
113
113
Alignment,
114
- pi::pi_cast <cl_int *>(ErrcodeRet));
114
+ pi::cast <cl_int *>(ErrcodeRet));
115
115
} else {
116
116
RetVal = pfn_clSharedMemAllocINTEL (CLContext, CLDevice, Properties, Size,
117
117
Alignment,
118
- pi::pi_cast <cl_int *>(ErrcodeRet));
118
+ pi::cast <cl_int *>(ErrcodeRet));
119
119
}
120
120
}
121
121
@@ -128,8 +128,8 @@ void *USMDispatcher::sharedMemAlloc(pi_context Context, pi_device Device,
128
128
pi_result USMDispatcher::memFree (pi_context Context, void *Ptr) {
129
129
pi_result RetVal = PI_INVALID_OPERATION;
130
130
131
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
132
- cl_context CLContext = pi::pi_cast <cl_context>(Context);
131
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
132
+ cl_context CLContext = pi::cast <cl_context>(Context);
133
133
134
134
if (mEmulated ) {
135
135
RetVal = PI_CALL_RESULT (mEmulator ->memFree (CLContext, Ptr));
@@ -146,8 +146,8 @@ pi_result USMDispatcher::setKernelArgMemPointer(pi_kernel Kernel,
146
146
const void *ArgValue) {
147
147
pi_result RetVal = PI_INVALID_OPERATION;
148
148
149
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
150
- cl_kernel CLKernel = pi::pi_cast <cl_kernel>(Kernel);
149
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
150
+ cl_kernel CLKernel = pi::cast <cl_kernel>(Kernel);
151
151
152
152
if (mEmulated ) {
153
153
RetVal = PI_CALL_RESULT (
@@ -162,9 +162,9 @@ pi_result USMDispatcher::setKernelArgMemPointer(pi_kernel Kernel,
162
162
}
163
163
164
164
void USMDispatcher::setKernelIndirectAccess (pi_kernel Kernel, pi_queue Queue) {
165
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
166
- cl_kernel CLKernel = pi::pi_cast <cl_kernel>(Kernel);
167
- cl_command_queue CLQueue = pi::pi_cast <cl_command_queue>(Queue);
165
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
166
+ cl_kernel CLKernel = pi::cast <cl_kernel>(Kernel);
167
+ cl_command_queue CLQueue = pi::cast <cl_command_queue>(Queue);
168
168
cl_bool TrueVal = CL_TRUE;
169
169
170
170
if (mEmulated ) {
@@ -199,8 +199,8 @@ pi_result USMDispatcher::enqueueMemset(pi_queue Queue, void *Ptr,
199
199
pi_event *Event) {
200
200
pi_result RetVal = PI_INVALID_OPERATION;
201
201
202
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
203
- cl_command_queue CLQueue = pi::pi_cast <cl_command_queue>(Queue);
202
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
203
+ cl_command_queue CLQueue = pi::cast <cl_command_queue>(Queue);
204
204
205
205
// Is there a better way to convert pi_event * to cl_event *?
206
206
@@ -230,8 +230,8 @@ pi_result USMDispatcher::enqueueMemcpy(pi_queue Queue, pi_bool Blocking,
230
230
pi_event *Event) {
231
231
pi_result RetVal = PI_INVALID_OPERATION;
232
232
233
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
234
- cl_command_queue CLQueue = pi::pi_cast <cl_command_queue>(Queue);
233
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
234
+ cl_command_queue CLQueue = pi::cast <cl_command_queue>(Queue);
235
235
236
236
if (mEmulated ) {
237
237
RetVal = PI_CALL_RESULT (clEnqueueSVMMemcpy (
@@ -257,8 +257,8 @@ pi_result USMDispatcher::enqueueMigrateMem(pi_queue Queue, const void *Ptr,
257
257
pi_event *Event) {
258
258
pi_result RetVal = PI_INVALID_OPERATION;
259
259
260
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
261
- cl_command_queue CLQueue = pi::pi_cast <cl_command_queue>(Queue);
260
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
261
+ cl_command_queue CLQueue = pi::cast <cl_command_queue>(Queue);
262
262
263
263
if (mEmulated ) {
264
264
// We could check for OpenCL 2.1 and call the SVM migrate
@@ -286,8 +286,8 @@ pi_result USMDispatcher::enqueueMemAdvise(pi_queue Queue, void *Ptr,
286
286
pi_event *Event) {
287
287
pi_result RetVal = PI_INVALID_OPERATION;
288
288
289
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
290
- cl_command_queue CLQueue = pi::pi_cast <cl_command_queue>(Queue);
289
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
290
+ cl_command_queue CLQueue = pi::cast <cl_command_queue>(Queue);
291
291
292
292
if (mEmulated ) {
293
293
// TODO: What should we do here?
@@ -316,8 +316,8 @@ pi_result USMDispatcher::getMemAllocInfo(pi_context Context, const void *Ptr,
316
316
size_t *ParamValueSizeRet) {
317
317
pi_result RetVal = PI_INVALID_OPERATION;
318
318
319
- if (pi::piUseBackend (pi::PiBackend ::SYCL_BE_PI_OPENCL)) {
320
- cl_context CLContext = pi::pi_cast <cl_context>(Context);
319
+ if (pi::useBackend (pi::Backend ::SYCL_BE_PI_OPENCL)) {
320
+ cl_context CLContext = pi::cast <cl_context>(Context);
321
321
322
322
if (mEmulated ) {
323
323
// TODO: What should we do here?
0 commit comments