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

This commit is contained in:
Danylo Lytovchenko
2025-08-20 16:28:06 +02:00
committed by GitHub
parent 5840940caa
commit f7338717ae
1574 changed files with 162972 additions and 199346 deletions
@@ -44,8 +44,8 @@ void OCLUnalignedCopy::open(unsigned int test, char* units, double& conversion,
CHECK_RESULT((error_ != CL_SUCCESS), "Error opening test");
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)) {
@@ -54,18 +54,17 @@ void OCLUnalignedCopy::open(unsigned int test, char* units, double& conversion,
return;
}
cl_mem buffer;
buffer = _wrapper->clCreateBuffer(context_, CL_MEM_READ_ONLY,
BufSize * sizeof(cl_int4), NULL, &error_);
buffer = _wrapper->clCreateBuffer(context_, CL_MEM_READ_ONLY, BufSize * sizeof(cl_int4), NULL,
&error_);
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateBuffer() failed");
buffers_.push_back(buffer);
buffer = _wrapper->clCreateBuffer(context_, CL_MEM_WRITE_ONLY,
BufSize * sizeof(cl_int4), NULL, &error_);
buffer = _wrapper->clCreateBuffer(context_, CL_MEM_WRITE_ONLY, BufSize * sizeof(cl_int4), NULL,
&error_);
buffers_.push_back(buffer);
}
static void CL_CALLBACK notify_callback(const char* errinfo,
const void* private_info, size_t cb,
static void CL_CALLBACK notify_callback(const char* errinfo, const void* private_info, size_t cb,
void* user_data) {}
void OCLUnalignedCopy::run(void) {
@@ -82,37 +81,31 @@ void OCLUnalignedCopy::run(void) {
static const char TestCnt = 7;
char sizes[TestCnt][3] = {
{5, 7, 13}, {5, 7, 12}, {4, 9, 12}, {4, 9, 15},
{27, 16, 15}, {27, 16, 13}, {32, 16, 13},
{5, 7, 13}, {5, 7, 12}, {4, 9, 12}, {4, 9, 15}, {27, 16, 15}, {27, 16, 13}, {32, 16, 13},
};
for (int i = 0; i < TestCnt; ++i) {
error_ = _wrapper->clEnqueueWriteBuffer(cmdQueues_[_deviceId], buffers_[0],
CL_FALSE, 0, BufSize, values, 0,
NULL, NULL);
error_ = _wrapper->clEnqueueWriteBuffer(cmdQueues_[_deviceId], buffers_[0], CL_FALSE, 0,
BufSize, values, 0, NULL, NULL);
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueWriteBuffer() failed");
cl_uint pattern = 0;
error_ = /*_wrapper->*/ clEnqueueFillBuffer(
cmdQueues_[_deviceId], buffers_[1], &pattern, sizeof(pattern), 0,
BufSize, 0, NULL, NULL);
error_ = /*_wrapper->*/ clEnqueueFillBuffer(cmdQueues_[_deviceId], buffers_[1], &pattern,
sizeof(pattern), 0, BufSize, 0, NULL, NULL);
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueFillBuffer() failed");
error_ = _wrapper->clEnqueueCopyBuffer(
cmdQueues_[_deviceId], buffers_[0], buffers_[1], sizes[i][0],
sizes[i][1], sizes[i][2], 0, NULL, NULL);
error_ = _wrapper->clEnqueueCopyBuffer(cmdQueues_[_deviceId], buffers_[0], buffers_[1],
sizes[i][0], sizes[i][1], sizes[i][2], 0, NULL, NULL);
CHECK_RESULT(error_, "clEnqueueCopyBuffer failed");
error_ = _wrapper->clEnqueueReadBuffer(cmdQueues_[_deviceId], buffers_[1],
CL_TRUE, 0, BufSize, results, 0,
NULL, NULL);
error_ = _wrapper->clEnqueueReadBuffer(cmdQueues_[_deviceId], buffers_[1], CL_TRUE, 0, BufSize,
results, 0, NULL, NULL);
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueReadBuffer() failed");
for (int j = 0; j < sizes[i][1]; ++j) {
CHECK_RESULT(results[j] != 0, "Comparison failed");
}
for (int j = sizes[i][1], k = 0; j < (sizes[i][1] + sizes[i][2]);
++j, ++k) {
for (int j = sizes[i][1], k = 0; j < (sizes[i][1] + sizes[i][2]); ++j, ++k) {
CHECK_RESULT(results[j] != sizes[i][0] + k, "Comparison failed");
}
for (int j = (sizes[i][1] + sizes[i][2]); j < BufSize; ++j) {