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

Šī revīzija ir iekļauta:
Danylo Lytovchenko
2025-08-20 16:28:06 +02:00
revīziju iesūtīja GitHub
vecāks 5840940caa
revīzija f7338717ae
1574 mainīti faili ar 162972 papildinājumiem un 199346 dzēšanām
@@ -42,15 +42,15 @@ OCLCreateBuffer::OCLCreateBuffer() {
OCLCreateBuffer::~OCLCreateBuffer() {}
void OCLCreateBuffer::open(unsigned int test, char *units, double &conversion,
void OCLCreateBuffer::open(unsigned int test, char* units, double& conversion,
unsigned int deviceId) {
OCLTestImp::open(test, units, conversion, deviceId);
CHECK_RESULT((error_ != CL_SUCCESS), "Error opening test");
testID_ = test;
size_t size;
_wrapper->clGetDeviceInfo(devices_[deviceId], CL_DEVICE_MAX_MEM_ALLOC_SIZE,
sizeof(cl_ulong), &maxSize_, &size);
_wrapper->clGetDeviceInfo(devices_[deviceId], CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(cl_ulong),
&maxSize_, &size);
//! Workaround out of range issue in Windows 32bit apps
#if defined(_WIN32) && !defined(_WIN64)
static const size_t MaxSizeLimit = 512 * 1024 * 1024;
@@ -60,14 +60,13 @@ void OCLCreateBuffer::open(unsigned int test, char *units, double &conversion,
#endif
#if EMU_ENV
maxSize_ = 1000;
#endif // EMU_ENV
#endif // EMU_ENV
cl_mem buf = NULL;
// Make sure to use a size that's multiple of 8 (64bit).
maxSize_ &= 0xFFFFFFFFFFFFFFF8;
buf = _wrapper->clCreateBuffer(context_, CL_MEM_READ_WRITE, maxSize_, NULL,
&error_);
buf = _wrapper->clCreateBuffer(context_, CL_MEM_READ_WRITE, maxSize_, NULL, &error_);
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateBuffer() failed");
buffers_.push_back(buf);
@@ -79,9 +78,8 @@ void OCLCreateBuffer::run(void) {
cl_ulong pattern = PATTERN_20_64BIT;
timer.Reset();
timer.Start();
error_ = /*_wrapper->*/ clEnqueueFillBuffer(
cmdQueues_[_deviceId], buffers_[0], &pattern, sizeof(pattern), 0,
maxSize_, 0, NULL, NULL);
error_ = /*_wrapper->*/ clEnqueueFillBuffer(cmdQueues_[_deviceId], buffers_[0], &pattern,
sizeof(pattern), 0, maxSize_, 0, NULL, NULL);
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueFillBuffer() failed");
_wrapper->clFinish(cmdQueues_[_deviceId]);
@@ -93,7 +91,7 @@ void OCLCreateBuffer::run(void) {
maxSteps = (size_t)pages * page_size / 2;
}
#endif
void *resultBuf = NULL;
void* resultBuf = NULL;
// Reduce the buffer for the step transfers ahead of the allocation,
// since huge buffers may cause paging and very low performance
@@ -131,8 +129,7 @@ void OCLCreateBuffer::run(void) {
testDescString = str.str();
}
void OCLCreateBuffer::checkResult(size_t maxSteps, void *resultBuf,
cl_ulong pattern) {
void OCLCreateBuffer::checkResult(size_t maxSteps, void* resultBuf, cl_ulong pattern) {
size_t startPoint = 0;
while ((startPoint) < maxSize_) {
cl_event ee;
@@ -140,16 +137,15 @@ void OCLCreateBuffer::checkResult(size_t maxSteps, void *resultBuf,
if ((startPoint + maxSteps) > maxSize_) {
readSize = maxSize_ - startPoint;
}
error_ = /*wrapper->*/ clEnqueueReadBuffer(
cmdQueues_[_deviceId], buffers_[0], CL_FALSE, startPoint, readSize,
resultBuf, 0, NULL, &ee);
error_ = /*wrapper->*/ clEnqueueReadBuffer(cmdQueues_[_deviceId], buffers_[0], CL_FALSE,
startPoint, readSize, resultBuf, 0, NULL, &ee);
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueReadBuffer() failed");
_wrapper->clFinish(cmdQueues_[_deviceId]);
size_t err_cnt = 0;
size_t chk_cnt = readSize / sizeof(cl_ulong);
cl_ulong *cc = reinterpret_cast<cl_ulong*>(resultBuf);
cl_ulong* cc = reinterpret_cast<cl_ulong*>(resultBuf);
for (size_t i = 0; i < chk_cnt; i++) {
if (cc[i] != pattern) {
@@ -165,7 +161,7 @@ void OCLCreateBuffer::checkResult(size_t maxSteps, void *resultBuf,
}
}
void OCLCreateBuffer::writeBuffer(size_t maxSteps, void *dataBuf) {
void OCLCreateBuffer::writeBuffer(size_t maxSteps, void* dataBuf) {
size_t startPoint = 0;
while ((startPoint) < maxSize_) {
cl_event ee;
@@ -173,9 +169,8 @@ void OCLCreateBuffer::writeBuffer(size_t maxSteps, void *dataBuf) {
if ((startPoint + maxSteps) > maxSize_) {
writeSize = maxSize_ - startPoint;
}
error_ = /*wrapper->*/ clEnqueueWriteBuffer(
cmdQueues_[_deviceId], buffers_[0], CL_FALSE, startPoint, writeSize,
dataBuf, 0, NULL, &ee);
error_ = /*wrapper->*/ clEnqueueWriteBuffer(cmdQueues_[_deviceId], buffers_[0], CL_FALSE,
startPoint, writeSize, dataBuf, 0, NULL, &ee);
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueWriteBuffer() failed");
_wrapper->clFinish(cmdQueues_[_deviceId]);
startPoint += maxSteps;