2
0

SWDEV-470698 - fix formatting, add format check workflow (#657)

Este cometimento está contido em:
Danylo Lytovchenko
2025-08-20 16:28:06 +02:00
cometido por GitHub
ascendente 5840940caa
cometimento f7338717ae
1574 ficheiros modificados com 162972 adições e 199346 eliminações
@@ -91,8 +91,7 @@ bool OCLGLCommon::initializeGLContext(OCLGLHandle& hGL) {
pfd.dwDamageMask = 0;
dispDevice.cb = sizeof(DISPLAY_DEVICE);
for (deviceNum = 0; EnumDisplayDevices(NULL, deviceNum, &dispDevice, 0);
deviceNum++) {
for (deviceNum = 0; EnumDisplayDevices(NULL, deviceNum, &dispDevice, 0); deviceNum++) {
if (dispDevice.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) {
continue;
}
@@ -149,8 +148,8 @@ bool OCLGLCommon::checkAssociationDeviceWithGLContext(OCLGLHandle& hGL) {
(cl_context_properties)hGL->hdc,
0};
error_ = _wrapper->clGetGLContextInfoKHR(
properties, CL_DEVICES_FOR_GL_CONTEXT_KHR, 0, NULL, &devicesSize);
error_ = _wrapper->clGetGLContextInfoKHR(properties, CL_DEVICES_FOR_GL_CONTEXT_KHR, 0, NULL,
&devicesSize);
if (error_ != CL_SUCCESS) {
printf("clGetGLContextInfoKHR failed (%d)\n", error_);
return false;
@@ -159,9 +158,8 @@ bool OCLGLCommon::checkAssociationDeviceWithGLContext(OCLGLHandle& hGL) {
cl_uint numDevices = (cl_uint)devicesSize / sizeof(cl_device_id);
cl_device_id* interopDevices = (cl_device_id*)malloc(devicesSize);
error_ =
_wrapper->clGetGLContextInfoKHR(properties, CL_DEVICES_FOR_GL_CONTEXT_KHR,
devicesSize, interopDevices, NULL);
error_ = _wrapper->clGetGLContextInfoKHR(properties, CL_DEVICES_FOR_GL_CONTEXT_KHR, devicesSize,
interopDevices, NULL);
if (error_ != CL_SUCCESS) {
printf("clGetGLContextInfoKHR failed (%d)\n", error_);
free(interopDevices);
@@ -192,8 +190,7 @@ void OCLGLCommon::createCLContextFromGLContext(OCLGLHandle& hGL) {
// Release current command queue
if (cmdQueues_[_deviceId]) {
error_ = _wrapper->clReleaseCommandQueue(cmdQueues_[_deviceId]);
CHECK_RESULT_NO_RETURN((error_ != CL_SUCCESS),
"clReleaseCommandQueue() failed");
CHECK_RESULT_NO_RETURN((error_ != CL_SUCCESS), "clReleaseCommandQueue() failed");
}
// Release current context
@@ -203,15 +200,12 @@ void OCLGLCommon::createCLContextFromGLContext(OCLGLHandle& hGL) {
}
// Create new CL context from GL context
context_ =
clCreateContext(properties, 1, &devices_[_deviceId], NULL, NULL, &error_);
context_ = clCreateContext(properties, 1, &devices_[_deviceId], NULL, NULL, &error_);
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateContext() failed (%d)", error_);
// Create command queue for new context
cmdQueues_[_deviceId] =
_wrapper->clCreateCommandQueue(context_, devices_[_deviceId], 0, &error_);
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateCommandQueue() failed (%d)",
error_);
cmdQueues_[_deviceId] = _wrapper->clCreateCommandQueue(context_, devices_[_deviceId], 0, &error_);
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateCommandQueue() failed (%d)", error_);
GLenum glErr = glewInit();
CHECK_RESULT((glErr != GLEW_OK), "glewInit() failed");
@@ -225,8 +219,8 @@ void OCLGLCommon::makeCurrent(OCLGLHandle hGL) {
}
}
void OCLGLCommon::getCLContextPropertiesFromGLContext(
const OCLGLHandle hGL, cl_context_properties properties[7]) {
void OCLGLCommon::getCLContextPropertiesFromGLContext(const OCLGLHandle hGL,
cl_context_properties properties[7]) {
if (!properties) return;
properties[0] = CL_CONTEXT_PLATFORM;