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

Этот коммит содержится в:
Danylo Lytovchenko authored and GitHub committed 2025-08-20 19:58:06 +05:30
1 родитель 5840940caa
Коммит f7338717ae
1574 files changed
+162903 -199277

No files matched your search

+12 -16
Просмотреть файл
@@ -515,8 +515,8 @@ void OCLBlitKernel::open(unsigned int test, char* units, double& conversion,
std::string options = "-cl-std=CL2.0 -DOCL20=1";
cl_device_type deviceType;
error_ = _wrapper->clGetDeviceInfo(devices_[deviceId], CL_DEVICE_TYPE,
sizeof(deviceType), &deviceType, NULL);
error_ = _wrapper->clGetDeviceInfo(devices_[deviceId], CL_DEVICE_TYPE, sizeof(deviceType),
&deviceType, NULL);
CHECK_RESULT((error_ != CL_SUCCESS), "CL_DEVICE_TYPE failed");
if (!(deviceType & CL_DEVICE_TYPE_GPU)) {
@@ -526,12 +526,11 @@ void OCLBlitKernel::open(unsigned int test, char* units, double& conversion,
size_t param_size = 0;
char* strVersion = 0;
error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DEVICE_VERSION, 0,
0, &param_size);
error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DEVICE_VERSION, 0, 0, &param_size);
CHECK_RESULT(error_ != CL_SUCCESS, "clGetDeviceInfo failed");
strVersion = new char[param_size];
error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DEVICE_VERSION,
param_size, strVersion, 0);
error_ =
_wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DEVICE_VERSION, param_size, strVersion, 0);
CHECK_RESULT(error_ != CL_SUCCESS, "clGetDeviceInfo failed");
if (strVersion[7] < '2') {
options = "-DOCL20=0";
@@ -542,12 +541,11 @@ void OCLBlitKernel::open(unsigned int test, char* units, double& conversion,
}
delete strVersion;
error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DRIVER_VERSION, 0,
0, &param_size);
error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DRIVER_VERSION, 0, 0, &param_size);
CHECK_RESULT(error_ != CL_SUCCESS, "clGetDeviceInfo failed");
strVersion = new char[param_size];
error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DRIVER_VERSION,
param_size, strVersion, 0);
error_ =
_wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DRIVER_VERSION, param_size, strVersion, 0);
CHECK_RESULT(error_ != CL_SUCCESS, "clGetDeviceInfo failed");
std::string sch = strKernel;
@@ -577,15 +575,13 @@ void OCLBlitKernel::open(unsigned int test, char* units, double& conversion,
timer.Start();
const char* strProgram = sch.c_str();
program_ = _wrapper->clCreateProgramWithSource(context_, 1, &strProgram, NULL,
&error_);
program_ = _wrapper->clCreateProgramWithSource(context_, 1, &strProgram, NULL, &error_);
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateProgramWithSource() failed");
error_ = _wrapper->clBuildProgram(program_, 1, &devices_[deviceId],
options.c_str(), NULL, NULL);
error_ = _wrapper->clBuildProgram(program_, 1, &devices_[deviceId], options.c_str(), NULL, NULL);
if (error_ != CL_SUCCESS) {
char programLog[1024];
_wrapper->clGetProgramBuildInfo(program_, devices_[deviceId],
CL_PROGRAM_BUILD_LOG, 1024, programLog, 0);
_wrapper->clGetProgramBuildInfo(program_, devices_[deviceId], CL_PROGRAM_BUILD_LOG, 1024,
programLog, 0);
printf("\n%s\n", programLog);
fflush(stdout);
}