diff options
Diffstat (limited to 'opencl/source/opencl_device.cxx')
-rw-r--r-- | opencl/source/opencl_device.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx index c04fb4b8584a..112e03c6d968 100644 --- a/opencl/source/opencl_device.cxx +++ b/opencl/source/opencl_device.cxx @@ -216,7 +216,7 @@ ds_status deserializeScore(ds_device* device, const unsigned char* serializedSco /* Releases memory held by score */ ds_status releaseScore(void* score) { - if (NULL != score) + if (nullptr != score) { delete static_cast<LibreOfficeDeviceScore*>(score); } @@ -233,15 +233,15 @@ ds_status evaluateScoreForDevice(ds_device* device, void* evalData) cl_int clStatus; /* Check for 64-bit float extensions */ size_t aDevExtInfoSize = 0; - clStatus = clGetDeviceInfo(device->oclDeviceID, CL_DEVICE_EXTENSIONS, 0, NULL, &aDevExtInfoSize); + clStatus = clGetDeviceInfo(device->oclDeviceID, CL_DEVICE_EXTENSIONS, 0, nullptr, &aDevExtInfoSize); DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clGetDeviceInfo"); char* aExtInfo = new char[aDevExtInfoSize]; - clStatus = clGetDeviceInfo(device->oclDeviceID, CL_DEVICE_EXTENSIONS, sizeof(char) * aDevExtInfoSize, aExtInfo, NULL); + clStatus = clGetDeviceInfo(device->oclDeviceID, CL_DEVICE_EXTENSIONS, sizeof(char) * aDevExtInfoSize, aExtInfo, nullptr); DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clGetDeviceInfo"); bool bKhrFp64Flag = false; bool bAmdFp64Flag = false; - const char* buildOption = NULL; + const char* buildOption = nullptr; std::string tmpStr("-Dfp_t=double -Dfp_t4=double4 -Dfp_t16=double16 -DINPUTSIZE="); std::ostringstream tmpOStrStr; tmpOStrStr << std::dec << INPUTSIZE; @@ -278,7 +278,7 @@ ds_status evaluateScoreForDevice(ds_device* device, void* evalData) /* 64-bit float support present */ /* Create context and command queue */ - cl_context clContext = clCreateContext(NULL, 1, &device->oclDeviceID, NULL, NULL, &clStatus); + cl_context clContext = clCreateContext(nullptr, 1, &device->oclDeviceID, nullptr, nullptr, &clStatus); DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clCreateContext"); cl_command_queue clQueue = clCreateCommandQueue(clContext, device->oclDeviceID, 0, &clStatus); DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clCreateCommandQueue"); @@ -286,14 +286,14 @@ ds_status evaluateScoreForDevice(ds_device* device, void* evalData) /* Build program */ cl_program clProgram = clCreateProgramWithSource(clContext, 1, &source, sourceSize, &clStatus); DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clCreateProgramWithSource"); - clStatus = clBuildProgram(clProgram, 1, &device->oclDeviceID, buildOption, NULL, NULL); + clStatus = clBuildProgram(clProgram, 1, &device->oclDeviceID, buildOption, nullptr, nullptr); DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clBuildProgram"); if (CL_SUCCESS != clStatus) { /* Build program failed */ size_t length; char* buildLog; - clStatus = clGetProgramBuildInfo(clProgram, device->oclDeviceID, CL_PROGRAM_BUILD_LOG, 0, NULL, &length); + clStatus = clGetProgramBuildInfo(clProgram, device->oclDeviceID, CL_PROGRAM_BUILD_LOG, 0, nullptr, &length); buildLog = static_cast<char*>(malloc(length)); clGetProgramBuildInfo(clProgram, device->oclDeviceID, CL_PROGRAM_BUILD_LOG, length, buildLog, &length); SAL_INFO("opencl.device", "Build Errors:\n" << buildLog); @@ -335,7 +335,7 @@ ds_status evaluateScoreForDevice(ds_device* device, void* evalData) DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clSetKernelArg::clInput3"); size_t globalWS[1] = { testData->outputSize }; size_t localSize[1] = { 64 }; - clStatus = clEnqueueNDRangeKernel(clQueue, clKernel, 1, 0, globalWS, localSize, 0, NULL, NULL); + clStatus = clEnqueueNDRangeKernel(clQueue, clKernel, 1, nullptr, globalWS, localSize, 0, nullptr, nullptr); DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clEnqueueNDRangeKernel"); clFinish(clQueue); clReleaseMemObject(clInput3); @@ -485,7 +485,7 @@ ds_device getDeviceSelection(const char* sProfilePath, bool bForceSelection) if (!bIsDeviceSelected || bForceSelection) { /* Setup */ - ds_profile* profile = NULL; + ds_profile* profile = nullptr; initDSProfile(&profile, "LibreOffice v0.1"); if (!profile) @@ -559,7 +559,7 @@ ds_device getDeviceSelection(const char* sProfilePath, bool bForceSelection) /* Override if necessary */ char* overrideDeviceStr = getenv("SC_OPENCL_DEVICE_OVERRIDE"); - if (NULL != overrideDeviceStr) + if (nullptr != overrideDeviceStr) { int overrideDeviceIdx = matchDevice(profile, overrideDeviceStr); if (-1 != overrideDeviceIdx) |