From 91e814f66f5561798902f767d64c4366b376a1d3 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sun, 17 Nov 2013 18:16:35 +0100 Subject: add a way to blacklist known bad OpenCL compilers the blacklisted compiler hangs while compiling the opencl-test kernels on the @38 tinderbox. Change-Id: Ice80253a5fbb66eef4bfb4a3efd881fc83c379b4 --- sc/inc/platforminfo.hxx | 1 + sc/source/core/opencl/openclwrapper.cxx | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'sc') diff --git a/sc/inc/platforminfo.hxx b/sc/inc/platforminfo.hxx index 7a48e110a7c2..71206e01a94b 100644 --- a/sc/inc/platforminfo.hxx +++ b/sc/inc/platforminfo.hxx @@ -23,6 +23,7 @@ struct SC_DLLPUBLIC OpenclDeviceInfo void* device; OUString maName; OUString maVendor; + OUString maDriver; size_t mnMemory; size_t mnComputeUnits; size_t mnFrequency; diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx index b7e1f9143b35..8ca70d0019d4 100644 --- a/sc/source/core/opencl/openclwrapper.cxx +++ b/sc/source/core/opencl/openclwrapper.cxx @@ -698,6 +698,26 @@ int OpenclDevice::getOpenclState() namespace { +// based on crashes and hanging during kernel compilation +bool checkForKnownBadCompilers(const OpenclDeviceInfo& rInfo) +{ + + struct { + const char* pVendorName; const char* pDriverVersion; + } aBadOpenCLCompilers[] = { + { "Intel(R) Corporation", "9.17.10.2884" } + }; + + for(size_t i = 0; i < SAL_N_ELEMENTS(aBadOpenCLCompilers); ++i) + { + if(rInfo.maVendor == OUString::createFromAscii(aBadOpenCLCompilers[i].pVendorName) && + rInfo.maDriver == OUString::createFromAscii(aBadOpenCLCompilers[i].pDriverVersion)) + return true; + } + + return false; +} + void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo) { OpenclDeviceInfo aDeviceInfo; @@ -736,6 +756,14 @@ void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo) if(nState != CL_SUCCESS) return; + char pDriver[DEVICE_NAME_LENGTH]; + nState = clGetDeviceInfo(aDeviceId, CL_DRIVER_VERSION, DEVICE_NAME_LENGTH, pDriver, NULL); + + if(nState != CL_SUCCESS) + return; + + aDeviceInfo.maDriver = OUString::createFromAscii(pDriver); + bool bKhrFp64 = false; bool bAmdFp64 = false; checkDeviceForDoubleSupport(aDeviceId, bKhrFp64, bAmdFp64); @@ -746,7 +774,8 @@ void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo) aDeviceInfo.mnComputeUnits = nComputeUnits; - rPlatformInfo.maDevices.push_back(aDeviceInfo); + if(!checkForKnownBadCompilers(aDeviceInfo)) + rPlatformInfo.maDevices.push_back(aDeviceInfo); } bool createPlatformInfo(cl_platform_id nPlatformId, OpenclPlatformInfo& rPlatformInfo) -- cgit