diff options
Diffstat (limited to 'opencl/source/opencl_device.cxx')
-rw-r--r-- | opencl/source/opencl_device.cxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx index 3dc9a29413ad..cfeb290645ea 100644 --- a/opencl/source/opencl_device.cxx +++ b/opencl/source/opencl_device.cxx @@ -31,6 +31,8 @@ #include <sal/log.hxx> #include <rtl/math.hxx> +#include <opencl/OpenCLZone.hxx> + #include "opencl_device.hxx" #define INPUTSIZE 15360 @@ -201,14 +203,21 @@ ds_status evaluateScoreForDevice(ds_device& rDevice, std::unique_ptr<LibreOffice /* Evaluating an OpenCL device */ SAL_INFO("opencl.device", "Device: \"" << rDevice.sDeviceName << "\" (OpenCL) evaluation..."); cl_int clStatus; + /* Check for 64-bit float extensions */ - size_t aDevExtInfoSize = 0; - clStatus = clGetDeviceInfo(rDevice.aDeviceID, CL_DEVICE_EXTENSIONS, 0, nullptr, &aDevExtInfoSize); - DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clGetDeviceInfo"); + std::unique_ptr<char[]> aExtInfo; + { + size_t aDevExtInfoSize = 0; + + OpenCLZone zone; + clStatus = clGetDeviceInfo(rDevice.aDeviceID, CL_DEVICE_EXTENSIONS, 0, nullptr, &aDevExtInfoSize); + DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clGetDeviceInfo"); + + aExtInfo.reset(new char[aDevExtInfoSize]); + clStatus = clGetDeviceInfo(rDevice.aDeviceID, CL_DEVICE_EXTENSIONS, sizeof(char) * aDevExtInfoSize, aExtInfo.get(), nullptr); + DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clGetDeviceInfo"); + } - std::unique_ptr<char[]> aExtInfo(new char[aDevExtInfoSize]); - clStatus = clGetDeviceInfo(rDevice.aDeviceID, CL_DEVICE_EXTENSIONS, sizeof(char) * aDevExtInfoSize, aExtInfo.get(), nullptr); - DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clGetDeviceInfo"); bool bKhrFp64Flag = false; bool bAmdFp64Flag = false; const char* buildOption = nullptr; @@ -245,6 +254,8 @@ ds_status evaluateScoreForDevice(ds_device& rDevice, std::unique_ptr<LibreOffice { /* 64-bit float support present */ + OpenCLZone zone; + /* Create context and command queue */ cl_context clContext = clCreateContext(nullptr, 1, &rDevice.aDeviceID, nullptr, nullptr, &clStatus); DS_CHECK_STATUS(clStatus, "evaluateScoreForDevice::clCreateContext"); |