Kaydet (Commit) 6f584490 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Make checkForKnownBadCompilers() public

Change-Id: Icddf3c158e5f45d30467d3da82c197901d8bc380
üst 8b290c56
......@@ -102,6 +102,8 @@ bool switchOpenCLDevice(const OUString* pDeviceId, bool bAutoSelect,
void getOpenCLDeviceInfo(size_t& rDeviceId, size_t& rPlatformId);
bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice);
}}
#endif
......
......@@ -564,27 +564,6 @@ bool match(const ScCalcConfig::OpenCLImplMatcherSet& rList, const OpenCLPlatform
}
// based on crashes and hanging during kernel compilation
bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
{
// Check blacklist of known bad OpenCL implementations
if (match(ScInterpreter::GetGlobalConfig().maOpenCLBlackList, rPlatform, rDevice, "blacklist"))
{
SAL_INFO("sc.opencl", "Rejecting");
return true;
}
// Check for whitelist of known good OpenCL implementations
if (match(ScInterpreter::GetGlobalConfig().maOpenCLWhiteList, rPlatform, rDevice, "whitelist"))
{
SAL_INFO("sc.opencl", "Approving");
return false;
}
// Fallback: reject
SAL_INFO("sc.opencl", "Fallback: rejecting platform=" << rPlatform << ", device=" << rDevice);
return true;
}
void createDeviceInfo(cl_device_id aDeviceId, OpenCLPlatformInfo& rPlatformInfo)
{
OpenCLDeviceInfo aDeviceInfo;
......@@ -685,6 +664,27 @@ bool createPlatformInfo(cl_platform_id nPlatformId, OpenCLPlatformInfo& rPlatfor
}
bool checkForKnownBadCompilers(const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice)
{
// Check blacklist of known bad OpenCL implementations
if (match(ScInterpreter::GetGlobalConfig().maOpenCLBlackList, rPlatform, rDevice, "blacklist"))
{
SAL_INFO("sc.opencl", "Rejecting");
return true;
}
// Check for whitelist of known good OpenCL implementations
if (match(ScInterpreter::GetGlobalConfig().maOpenCLWhiteList, rPlatform, rDevice, "whitelist"))
{
SAL_INFO("sc.opencl", "Approving");
return false;
}
// Fallback: reject
SAL_INFO("sc.opencl", "Fallback: rejecting platform=" << rPlatform << ", device=" << rDevice);
return true;
}
const std::vector<OpenCLPlatformInfo>& fillOpenCLInfo()
{
static std::vector<OpenCLPlatformInfo> aPlatforms;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment