Skip to content

Commit 3f5c662

Browse files
committed
[SYCL] Formatting and suggested changes.
Signed-off-by: Garima Gupta <garima.gupta@intel.com>
1 parent c8c4d15 commit 3f5c662

File tree

2 files changed

+50
-48
lines changed

2 files changed

+50
-48
lines changed

sycl/include/CL/sycl/detail/pi.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,15 @@ pi_result piextGetDeviceFunctionPointer(
448448
//
449449
pi_result piContextCreate(
450450
const cl_context_properties * properties, // TODO: untie from OpenCL
451-
pi_uint32 num_devices,
452-
const pi_device * devices,
453-
void (* pfn_notify)(
454-
const char * errinfo,
455-
const void * private_info,
456-
size_t cb,
457-
void * user_data),
458-
void * user_data,
459-
pi_context * retcontext);
451+
pi_uint32 num_devices,
452+
const pi_device * devices,
453+
void (*pfn_notify)(
454+
const char * errinfo,
455+
const void * private_info,
456+
size_t cb,
457+
void * user_data),
458+
void * user_data,
459+
pi_context * ret_context);
460460

461461
pi_result piContextGetInfo(
462462
pi_context context,

sycl/plugins/opencl/pi_opencl.cpp

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,20 @@ pi_result OCL(piextDeviceSelectBinary)(
8888
const char *image_target = nullptr;
8989
// Get the type of the device
9090
cl_device_type device_type;
91-
cl_int ret_err = clGetDeviceInfo(cast<cl_device_id>(device), CL_DEVICE_TYPE,
92-
sizeof(cl_device_type), &device_type, nullptr);
91+
cl_int ret_err =
92+
clGetDeviceInfo(cast<cl_device_id>(device), CL_DEVICE_TYPE,
93+
sizeof(cl_device_type), &device_type, nullptr);
9394
if (ret_err != CL_SUCCESS) {
9495
*selected_image = nullptr;
9596
return cast<pi_result>(ret_err);
9697
}
9798

9899
switch (device_type) {
99-
// TODO: Factor out vendor specifics into a separate source
100-
// E.g. sycl/source/detail/vendor/intel/detail/pi_opencl.cpp?
100+
// TODO: Factor out vendor specifics into a separate source
101+
// E.g. sycl/source/detail/vendor/intel/detail/pi_opencl.cpp?
101102

102-
// We'll attempt to find an image that was AOT-compiled
103-
// from a SPIR-V image into an image specific for:
103+
// We'll attempt to find an image that was AOT-compiled
104+
// from a SPIR-V image into an image specific for:
104105

105106
case CL_DEVICE_TYPE_CPU: // OpenCL 64-bit CPU
106107
image_target = PI_DEVICE_BINARY_TARGET_SPIRV64_X86_64;
@@ -181,8 +182,8 @@ pi_result OCL(piProgramCreate)(pi_context context, const void *il,
181182

182183
size_t deviceCount;
183184

184-
cl_int ret_err = clGetContextInfo(cast<cl_context>(context),
185-
CL_CONTEXT_DEVICES, 0, nullptr, &deviceCount);
185+
cl_int ret_err = clGetContextInfo(
186+
cast<cl_context>(context), CL_CONTEXT_DEVICES, 0, nullptr, &deviceCount);
186187

187188
std::vector<cl_device_id> devicesInCtx(deviceCount);
188189

@@ -205,8 +206,8 @@ pi_result OCL(piProgramCreate)(pi_context context, const void *il,
205206
CHECK_ERR_SET_NULL_RET(ret_err, res_program, CL_INVALID_CONTEXT);
206207

207208
size_t devVerSize;
208-
ret_err =
209-
clGetPlatformInfo(curPlatform, CL_PLATFORM_VERSION, 0, nullptr, &devVerSize);
209+
ret_err = clGetPlatformInfo(curPlatform, CL_PLATFORM_VERSION, 0, nullptr,
210+
&devVerSize);
210211
std::string devVer(devVerSize, '\0');
211212
ret_err = clGetPlatformInfo(curPlatform, CL_PLATFORM_VERSION, devVerSize,
212213
&devVer.front(), nullptr);
@@ -225,8 +226,8 @@ pi_result OCL(piProgramCreate)(pi_context context, const void *il,
225226
}
226227

227228
size_t extSize;
228-
ret_err =
229-
clGetPlatformInfo(curPlatform, CL_PLATFORM_EXTENSIONS, 0, nullptr, &extSize);
229+
ret_err = clGetPlatformInfo(curPlatform, CL_PLATFORM_EXTENSIONS, 0, nullptr,
230+
&extSize);
230231
std::string extStr(extSize, '\0');
231232
ret_err = clGetPlatformInfo(curPlatform, CL_PLATFORM_EXTENSIONS, extSize,
232233
&extStr.front(), nullptr);
@@ -330,9 +331,10 @@ pi_result OCL(piContextCreate)(
330331
void *user_data1),
331332
void *user_data, pi_context *retcontext) {
332333
pi_result ret = PI_INVALID_OPERATION;
333-
*retcontext = cast<pi_context>(clCreateContext(
334-
properties, cast<cl_uint>(num_devices), cast<const cl_device_id*>(devices),
335-
pfn_notify, user_data, cast<cl_int *>(&ret)));
334+
*retcontext = cast<pi_context>(
335+
clCreateContext(properties, cast<cl_uint>(num_devices),
336+
cast<const cl_device_id *>(devices), pfn_notify,
337+
user_data, cast<cl_int *>(&ret)));
336338

337339
return ret;
338340
}
@@ -467,46 +469,46 @@ _PI_CL(piDeviceRelease, clReleaseDevice)
467469
_PI_CL(piextDeviceSelectBinary, OCL(piextDeviceSelectBinary))
468470
_PI_CL(piextGetDeviceFunctionPointer, OCL(piextGetDeviceFunctionPointer))
469471
// Context
470-
_PI_CL(piContextCreate, OCL(piContextCreate))
471-
_PI_CL(piContextGetInfo, clGetContextInfo)
472-
_PI_CL(piContextRetain, clRetainContext)
473-
_PI_CL(piContextRelease, clReleaseContext)
472+
_PI_CL(piContextCreate, OCL(piContextCreate))
473+
_PI_CL(piContextGetInfo, clGetContextInfo)
474+
_PI_CL(piContextRetain, clRetainContext)
475+
_PI_CL(piContextRelease, clReleaseContext)
474476
// Queue
475477
_PI_CL(piQueueCreate, OCL(piQueueCreate))
476478
_PI_CL(piQueueGetInfo, clGetCommandQueueInfo)
477479
_PI_CL(piQueueFinish, clFinish)
478480
_PI_CL(piQueueRetain, clRetainCommandQueue)
479481
_PI_CL(piQueueRelease, clReleaseCommandQueue)
480482
// Memory
481-
_PI_CL(piMemBufferCreate, OCL(piMemBufferCreate))
482-
_PI_CL(piMemImageCreate, OCL(piMemImageCreate))
483-
_PI_CL(piMemGetInfo, clGetMemObjectInfo)
484-
_PI_CL(piMemImageGetInfo, clGetImageInfo)
485-
_PI_CL(piMemRetain, clRetainMemObject)
486-
_PI_CL(piMemRelease, clReleaseMemObject)
483+
_PI_CL(piMemBufferCreate, OCL(piMemBufferCreate))
484+
_PI_CL(piMemImageCreate, OCL(piMemImageCreate))
485+
_PI_CL(piMemGetInfo, clGetMemObjectInfo)
486+
_PI_CL(piMemImageGetInfo, clGetImageInfo)
487+
_PI_CL(piMemRetain, clRetainMemObject)
488+
_PI_CL(piMemRelease, clReleaseMemObject)
487489
_PI_CL(piMemBufferPartition, OCL(piMemBufferPartition))
488490
// Program
489-
_PI_CL(piProgramCreate, OCL(piProgramCreate))
491+
_PI_CL(piProgramCreate, OCL(piProgramCreate))
490492
_PI_CL(piclProgramCreateWithSource, OCL(piclProgramCreateWithSource))
491493
_PI_CL(piclProgramCreateWithBinary, OCL(piclProgramCreateWithBinary))
492-
_PI_CL(piProgramGetInfo, clGetProgramInfo)
493-
_PI_CL(piProgramCompile, clCompileProgram)
494-
_PI_CL(piProgramBuild, clBuildProgram)
495-
_PI_CL(piProgramLink, OCL(piProgramLink))
496-
_PI_CL(piProgramGetBuildInfo, clGetProgramBuildInfo)
497-
_PI_CL(piProgramRetain, clRetainProgram)
498-
_PI_CL(piProgramRelease, clReleaseProgram)
494+
_PI_CL(piProgramGetInfo, clGetProgramInfo)
495+
_PI_CL(piProgramCompile, clCompileProgram)
496+
_PI_CL(piProgramBuild, clBuildProgram)
497+
_PI_CL(piProgramLink, OCL(piProgramLink))
498+
_PI_CL(piProgramGetBuildInfo, clGetProgramBuildInfo)
499+
_PI_CL(piProgramRetain, clRetainProgram)
500+
_PI_CL(piProgramRelease, clReleaseProgram)
499501
// Kernel
500-
_PI_CL(piKernelCreate, OCL(piKernelCreate))
501-
_PI_CL(piKernelSetArg, clSetKernelArg)
502-
_PI_CL(piKernelGetInfo, clGetKernelInfo)
503-
_PI_CL(piKernelGetGroupInfo, clGetKernelWorkGroupInfo)
502+
_PI_CL(piKernelCreate, OCL(piKernelCreate))
503+
_PI_CL(piKernelSetArg, clSetKernelArg)
504+
_PI_CL(piKernelGetInfo, clGetKernelInfo)
505+
_PI_CL(piKernelGetGroupInfo, clGetKernelWorkGroupInfo)
504506
_PI_CL(piKernelGetSubGroupInfo, clGetKernelSubGroupInfo)
505507
_PI_CL(piKernelRetain, clRetainKernel)
506508
_PI_CL(piKernelRelease, clReleaseKernel)
507509
// Event
508-
_PI_CL(piEventCreate, OCL(piEventCreate))
509-
_PI_CL(piEventGetInfo, clGetEventInfo)
510+
_PI_CL(piEventCreate, OCL(piEventCreate))
511+
_PI_CL(piEventGetInfo, clGetEventInfo)
510512
_PI_CL(piEventGetProfilingInfo, clGetEventProfilingInfo)
511513
_PI_CL(piEventsWait, clWaitForEvents)
512514
_PI_CL(piEventSetCallback, clSetEventCallback)

0 commit comments

Comments
 (0)