SWDEV-470698 - fix formatting, add format check workflow (#657)
This commit is contained in:
committed by
GitHub
parent
5840940caa
commit
f7338717ae
@@ -53,21 +53,18 @@ void OCLGlobalOffset::open(unsigned int test, char* units, double& conversion,
|
||||
OCLTestImp::open(test, units, conversion, deviceId);
|
||||
CHECK_RESULT((error_ != CL_SUCCESS), "Error opening test");
|
||||
char dbuffer[1024] = {0};
|
||||
_wrapper->clGetDeviceInfo(devices_[0], CL_DEVICE_VERSION, 1024, dbuffer,
|
||||
NULL);
|
||||
_wrapper->clGetDeviceInfo(devices_[0], CL_DEVICE_VERSION, 1024, dbuffer, NULL);
|
||||
if (strstr(dbuffer, "OpenCL 1.0")) {
|
||||
return;
|
||||
}
|
||||
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], NULL,
|
||||
NULL, NULL);
|
||||
error_ = _wrapper->clBuildProgram(program_, 1, &devices_[deviceId], NULL, 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);
|
||||
}
|
||||
@@ -77,29 +74,26 @@ void OCLGlobalOffset::open(unsigned int test, char* units, double& conversion,
|
||||
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateKernel() failed");
|
||||
|
||||
cl_mem buffer;
|
||||
buffer = _wrapper->clCreateBuffer(context_, CL_MEM_READ_WRITE,
|
||||
ThreadsForCheck * sizeof(cl_uint), NULL,
|
||||
&error_);
|
||||
buffer = _wrapper->clCreateBuffer(context_, CL_MEM_READ_WRITE, ThreadsForCheck * sizeof(cl_uint),
|
||||
NULL, &error_);
|
||||
CHECK_RESULT((error_ != CL_SUCCESS), "clCreateBuffer() failed");
|
||||
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 OCLGlobalOffset::run(void) {
|
||||
char dbuffer[1024] = {0};
|
||||
_wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DEVICE_VERSION, 1024,
|
||||
dbuffer, NULL);
|
||||
_wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DEVICE_VERSION, 1024, dbuffer, NULL);
|
||||
if (strstr(dbuffer, "OpenCL 1.0")) {
|
||||
return;
|
||||
}
|
||||
cl_uint offsetValues[ThreadsForCheck] = {0xffffffff, 0xffffffff};
|
||||
cl_mem buffer = buffers()[0];
|
||||
error_ = _wrapper->clEnqueueWriteBuffer(cmdQueues_[_deviceId], buffer, true,
|
||||
0, ThreadsForCheck * sizeof(cl_uint),
|
||||
offsetValues, 0, NULL, NULL);
|
||||
error_ = _wrapper->clEnqueueWriteBuffer(cmdQueues_[_deviceId], buffer, true, 0,
|
||||
ThreadsForCheck * sizeof(cl_uint), offsetValues, 0, NULL,
|
||||
NULL);
|
||||
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueWriteBuffer() failed");
|
||||
|
||||
error_ = _wrapper->clSetKernelArg(kernel_, 0, sizeof(cl_mem), &buffer);
|
||||
@@ -107,13 +101,13 @@ void OCLGlobalOffset::run(void) {
|
||||
|
||||
size_t gws[1] = {0x0800000};
|
||||
size_t gwo[1] = {GlobalOffset};
|
||||
error_ = _wrapper->clEnqueueNDRangeKernel(cmdQueues_[_deviceId], kernel_, 1,
|
||||
gwo, gws, NULL, 0, NULL, NULL);
|
||||
error_ = _wrapper->clEnqueueNDRangeKernel(cmdQueues_[_deviceId], kernel_, 1, gwo, gws, NULL, 0,
|
||||
NULL, NULL);
|
||||
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueNDRangeKernel() failed");
|
||||
|
||||
error_ = _wrapper->clEnqueueReadBuffer(cmdQueues_[_deviceId], buffer, true, 0,
|
||||
ThreadsForCheck * sizeof(cl_uint),
|
||||
offsetValues, 0, NULL, NULL);
|
||||
error_ =
|
||||
_wrapper->clEnqueueReadBuffer(cmdQueues_[_deviceId], buffer, true, 0,
|
||||
ThreadsForCheck * sizeof(cl_uint), offsetValues, 0, NULL, NULL);
|
||||
CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueReadBuffer() failed");
|
||||
for (cl_uint i = 0; i < ThreadsForCheck; ++i) {
|
||||
if (offsetValues[i] != GlobalOffset) {
|
||||
|
||||
Reference in New Issue
Block a user