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ファイル変更
+162903 -199277

検索条件に一致するファイルはありません

+30 -42
ファイルの表示
@@ -63,10 +63,9 @@ const static char* strKernel = {KERNEL_CODE(
int gid = get_global_id(0);
int lid = get_local_id(0);
if (lid == 0) {
int enq_res =
enqueue_kernel(def_q, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange, ^{
childKernel(buf, level - 1);
});
int enq_res = enqueue_kernel(def_q, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange, ^{
childKernel(buf, level - 1);
});
}
} else {
int idx = get_global_id(0);
@@ -81,10 +80,9 @@ const static char* strKernel = {KERNEL_CODE(
int gid = get_global_id(0);
if (level) {
int enq_res =
enqueue_kernel(def_q, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange, ^{
childKernel(buf, level - 1);
});
int enq_res = enqueue_kernel(def_q, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange, ^{
childKernel(buf, level - 1);
});
}
}
\n)};
@@ -104,8 +102,8 @@ OCLPerfDeviceEnqueue2::OCLPerfDeviceEnqueue2() {
OCLPerfDeviceEnqueue2::~OCLPerfDeviceEnqueue2() {}
void OCLPerfDeviceEnqueue2::open(unsigned int test, char* units,
double& conversion, unsigned int deviceId) {
void OCLPerfDeviceEnqueue2::open(unsigned int test, char* units, double& conversion,
unsigned int deviceId) {
if (type_ == CL_DEVICE_TYPE_CPU) {
return;
}
@@ -120,12 +118,11 @@ void OCLPerfDeviceEnqueue2::open(unsigned int test, char* units,
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') {
failed_ = true;
@@ -133,16 +130,14 @@ void OCLPerfDeviceEnqueue2::open(unsigned int test, char* units,
}
delete strVersion;
program_ = _wrapper->clCreateProgramWithSource(context_, 1, &strKernel, NULL,
&error_);
program_ = _wrapper->clCreateProgramWithSource(context_, 1, &strKernel, NULL, &error_);
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateProgramWithSource() failed");
error_ = _wrapper->clBuildProgram(program_, 1, &devices_[deviceId],
"-cl-std=CL2.0", NULL, NULL);
error_ = _wrapper->clBuildProgram(program_, 1, &devices_[deviceId], "-cl-std=CL2.0", 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);
}
@@ -156,8 +151,7 @@ void OCLPerfDeviceEnqueue2::open(unsigned int test, char* units,
cl_mem buffer;
buffer = _wrapper->clCreateBuffer(context_, CL_MEM_ALLOC_HOST_PTR, 2048, NULL,
&error_);
buffer = _wrapper->clCreateBuffer(context_, CL_MEM_ALLOC_HOST_PTR, 2048, NULL, &error_);
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateBuffer() failed");
buffers_.push_back(buffer);
@@ -165,23 +159,19 @@ void OCLPerfDeviceEnqueue2::open(unsigned int test, char* units,
const cl_queue_properties cprops[] = {
CL_QUEUE_PROPERTIES,
static_cast<cl_queue_properties>(CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
CL_QUEUE_ON_DEVICE_DEFAULT |
CL_QUEUE_ON_DEVICE),
CL_QUEUE_ON_DEVICE_DEFAULT | CL_QUEUE_ON_DEVICE),
CL_QUEUE_SIZE, queueSize, 0};
deviceQueue_ = _wrapper->clCreateCommandQueueWithProperties(
context_, devices_[deviceId], cprops, &error_);
CHECK_RESULT((error_ != CL_SUCCESS),
"clCreateCommandQueueWithProperties() failed");
deviceQueue_ =
_wrapper->clCreateCommandQueueWithProperties(context_, devices_[deviceId], cprops, &error_);
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateCommandQueueWithProperties() failed");
#else
skip_ = true;
testDescString =
"DeviceEnqueue NOT supported for < 2.0 builds. Test Skipped.";
testDescString = "DeviceEnqueue NOT supported for < 2.0 builds. Test Skipped.";
return;
#endif
}
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 OCLPerfDeviceEnqueue2::run(void) {
@@ -209,8 +199,8 @@ void OCLPerfDeviceEnqueue2::run(void) {
error_ = _wrapper->clSetKernelArg(kernel_, 1, sizeof(unsigned int), &level);
CHECK_RESULT((error_ != CL_SUCCESS), "clSetKernelArg() failed");
error_ = _wrapper->clEnqueueNDRangeKernel(cmdQueues_[_deviceId], kernel_, 1,
NULL, gws, lws, 0, NULL, NULL);
error_ = _wrapper->clEnqueueNDRangeKernel(cmdQueues_[_deviceId], kernel_, 1, NULL, gws, lws, 0,
NULL, NULL);
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueNDRangeKernel() failed");
_wrapper->clFinish(cmdQueues_[_deviceId]);
@@ -222,8 +212,8 @@ void OCLPerfDeviceEnqueue2::run(void) {
timer.Reset();
timer.Start();
for (unsigned int i = 0; i < repeats; i++) {
error_ = _wrapper->clEnqueueNDRangeKernel(cmdQueues_[_deviceId], kernel_, 1,
NULL, gws, lws, 0, NULL, NULL);
error_ = _wrapper->clEnqueueNDRangeKernel(cmdQueues_[_deviceId], kernel_, 1, NULL, gws, lws, 0,
NULL, NULL);
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueNDRangeKernel() failed");
_wrapper->clFinish(cmdQueues_[_deviceId]);
@@ -234,10 +224,9 @@ void OCLPerfDeviceEnqueue2::run(void) {
_perfInfo = (float)(threads * repeats * level) / (float)(sec * 1000000.);
char buf[256];
SNPRINTF(
buf, sizeof(buf),
"%5d threads spawning 64 threads, queue size %3dKB (Mdisp/s), level=%2d",
threads, queueSize / 1024, level);
SNPRINTF(buf, sizeof(buf),
"%5d threads spawning 64 threads, queue size %3dKB (Mdisp/s), level=%2d", threads,
queueSize / 1024, level);
testDescString = buf;
}
@@ -249,8 +238,7 @@ unsigned int OCLPerfDeviceEnqueue2::close(void) {
if (deviceQueue_) {
error_ = _wrapper->clReleaseCommandQueue(deviceQueue_);
CHECK_RESULT_NO_RETURN(error_ != CL_SUCCESS,
"clReleaseCommandQueue failed");
CHECK_RESULT_NO_RETURN(error_ != CL_SUCCESS, "clReleaseCommandQueue failed");
}
if (kernel2_) {
error_ = _wrapper->clReleaseKernel(kernel2_);