Kaydet (Commit) 8003afa1 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Blacklist has precedence over whitelist, so order them like that

Change-Id: I0cf00abd582aaaaa4be4d385a6ef4f199c7aa0bc
üst d7b8a412
......@@ -1389,19 +1389,19 @@
</info>
<value/>
</prop>
<prop oor:name="OpenCLWhiteList" oor:type="oor:string-list" oor:nillable="false">
<prop oor:name="OpenCLBlackList" oor:type="oor:string-list" oor:nillable="false">
<!-- UIHints: Tools - Options Spreadsheet Formula -->
<info>
<desc>Combinations of (OS, OS version, OpenCL platform vendor, OpenCL device name, OpenCL driver version) that are known to be good. Has higher priority than OpenCLBlackList. Each entry is a string consisting of five parts separated by slashes. In case a slash occurs inside a part, it is prefixed by a backslash. And in case a backslash occurs inside a part, it is also prefixed by another backslash. Any part might contain a single asterisk as a wildcard, matching any value, but there is no more generic regexp support.</desc>
<desc>Combinations of (OS, OS version, OpenCL platform vendor, OpenCL device name, OpenCL driver version) that are known to be bad. Each entry is a string consisting of six parts separated by slashes. In case a slash, percent or semicolon occurs inside a part, it is replaced by a percent followed by the corresponding number as two hex digits. Any part might contain a single asterisk as a wildcard, matching any value, but there is no more generic regexp support. Has higher priority than OpenCLWhiteList.</desc>
</info>
<value oor:separator=";">Linux/*/Advanced Micro Devices, Inc./*/1445.5 (sse2,avx)/</value>
<value oor:separator=";">Windows/*/Intel(R) Corporation/*/9.17.10.2884/;SuperOS/*/Big Corp, Inc./Whizz\Grafix/4.2%2Fbeta%3B3/4.4</value>
</prop>
<prop oor:name="OpenCLBlackList" oor:type="oor:string-list" oor:nillable="false">
<prop oor:name="OpenCLWhiteList" oor:type="oor:string-list" oor:nillable="false">
<!-- UIHints: Tools - Options Spreadsheet Formula -->
<info>
<desc>Like OpenCLWhiteList, but for combinations known to be bad.</desc>
<desc>Like OpenCLWhiteList, but for combinations known to be good.</desc>
</info>
<value oor:separator=";">Windows/*/Intel(R) Corporation/*/9.17.10.2884/;SuperOS/*/Big Corp, Inc./Whizz\Grafix/4.2%2Fbeta%3B3/4.4</value>
<value oor:separator=";">Linux/*/Advanced Micro Devices, Inc./*/1445.5 (sse2,avx)/</value>
</prop>
</group>
<group oor:name="Syntax">
......
......@@ -114,8 +114,8 @@ struct SC_DLLPUBLIC ScCalcConfig
typedef std::set<OpenCLImplMatcher> OpenCLImplMatcherSet;
OpenCLImplMatcherSet maOpenCLWhiteList;
OpenCLImplMatcherSet maOpenCLBlackList;
OpenCLImplMatcherSet maOpenCLWhiteList;
ScCalcConfig();
......
......@@ -45,10 +45,10 @@ void ScCalcConfig::setOpenCLConfigToDefault()
maOpenCLSubsetOpCodes.insert(ocAverage);
maOpenCLSubsetOpCodes.insert(ocSumIfs);
maOpenCLWhiteList.insert(OpenCLImplMatcher("Linux", "*", "Advanced Micro Devices, Inc.", "*", "1445.5 (sse2,avx)", ""));
maOpenCLBlackList.insert(OpenCLImplMatcher("Windows", "*", "Intel(R) Corporation", "*", "9.17.10.2884", ""));
maOpenCLBlackList.insert(OpenCLImplMatcher("SuperOS", "*", "Big Corp, Inc.", "Whizz\\Grafix", "4.2/beta;3", "4.4"));
maOpenCLWhiteList.insert(OpenCLImplMatcher("Linux", "*", "Advanced Micro Devices, Inc.", "*", "1445.5 (sse2,avx)", ""));
}
void ScCalcConfig::reset()
......@@ -76,8 +76,9 @@ bool ScCalcConfig::operator== (const ScCalcConfig& r) const
maOpenCLDevice == r.maOpenCLDevice &&
mnOpenCLMinimumFormulaGroupSize == r.mnOpenCLMinimumFormulaGroupSize &&
maOpenCLSubsetOpCodes == r.maOpenCLSubsetOpCodes &&
maOpenCLBlackList == r.maOpenCLBlackList &&
maOpenCLWhiteList == r.maOpenCLWhiteList &&
maOpenCLBlackList == r.maOpenCLBlackList;
true;
}
bool ScCalcConfig::operator!= (const ScCalcConfig& r) const
......@@ -123,8 +124,8 @@ std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig& rConfig)
"OpenCLDevice='" << rConfig.maOpenCLDevice << "',"
"OpenCLMinimumFormulaGroupSize=" << rConfig.mnOpenCLMinimumFormulaGroupSize << ","
"OpenCLSubsetOpCodes={" << ScOpCodeSetToSymbolicString(rConfig.maOpenCLSubsetOpCodes) << "},"
"OpenCLWhiteList=" << rConfig.maOpenCLWhiteList << ","
"OpenCLBlackList=" << rConfig.maOpenCLBlackList <<
"OpenCLBlackList=" << rConfig.maOpenCLBlackList << ","
"OpenCLWhiteList=" << rConfig.maOpenCLWhiteList <<
"}";
return rStream;
}
......
......@@ -205,8 +205,8 @@ SfxPoolItem* ScTpFormulaItem::Clone( SfxItemPool * ) const
#define SCFORMULAOPT_OPENCL_SUBSET_ONLY 13
#define SCFORMULAOPT_OPENCL_MIN_SIZE 14
#define SCFORMULAOPT_OPENCL_SUBSET_OPS 15
#define SCFORMULAOPT_OPENCL_WHITELIST 16
#define SCFORMULAOPT_OPENCL_BLACKLIST 17
#define SCFORMULAOPT_OPENCL_BLACKLIST 16
#define SCFORMULAOPT_OPENCL_WHITELIST 17
#define SCFORMULAOPT_COUNT 18
Sequence<OUString> ScFormulaCfg::GetPropertyNames()
......@@ -229,8 +229,8 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames()
"Calculation/OpenCLSubsetOnly", // SCFORMULAOPT_OPENCL_SUBSET_ONLY
"Calculation/OpenCLMinimumDataSize", // SCFORMULAOPT_OPENCL_MIN_SIZE
"Calculation/OpenCLSubsetOpCodes", // SCFORMULAOPT_OPENCL_SUBSET_OPS
"Calculation/OpenCLWhiteList", // SCFORMULAOPT_OPENCL_WHITELIST
"Calculation/OpenCLBlackList", // SCFORMULAOPT_OPENCL_BLACKLIST
"Calculation/OpenCLWhiteList", // SCFORMULAOPT_OPENCL_WHITELIST
};
Sequence<OUString> aNames(SCFORMULAOPT_COUNT);
OUString* pNames = aNames.getArray();
......@@ -260,8 +260,8 @@ ScFormulaCfg::PropsToIds ScFormulaCfg::GetPropNamesToId()
SCFORMULAOPT_OPENCL_SUBSET_ONLY,
SCFORMULAOPT_OPENCL_MIN_SIZE,
SCFORMULAOPT_OPENCL_SUBSET_OPS,
SCFORMULAOPT_OPENCL_WHITELIST,
SCFORMULAOPT_OPENCL_BLACKLIST,
SCFORMULAOPT_OPENCL_WHITELIST,
};
OSL_ENSURE( SAL_N_ELEMENTS(aVals) == aPropNames.getLength(), "Properties and ids are out of Sync");
PropsToIds aPropIdMap;
......@@ -589,18 +589,18 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
GetCalcConfig().maOpenCLSubsetOpCodes = ScStringToOpCodeSet(sVal);
}
break;
case SCFORMULAOPT_OPENCL_WHITELIST:
case SCFORMULAOPT_OPENCL_BLACKLIST:
{
css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLWhiteList);
css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLBlackList);
pValues[nProp] >>= sVal;
GetCalcConfig().maOpenCLWhiteList = StringSequenceToSetOfOpenCLImplMatcher(sVal);
GetCalcConfig().maOpenCLBlackList = StringSequenceToSetOfOpenCLImplMatcher(sVal);
}
break;
case SCFORMULAOPT_OPENCL_BLACKLIST:
case SCFORMULAOPT_OPENCL_WHITELIST:
{
css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLBlackList);
css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLWhiteList);
pValues[nProp] >>= sVal;
GetCalcConfig().maOpenCLBlackList = StringSequenceToSetOfOpenCLImplMatcher(sVal);
GetCalcConfig().maOpenCLWhiteList = StringSequenceToSetOfOpenCLImplMatcher(sVal);
}
break;
}
......@@ -756,15 +756,15 @@ void ScFormulaCfg::Commit()
pValues[nProp] <<= sVal;
}
break;
case SCFORMULAOPT_OPENCL_WHITELIST:
case SCFORMULAOPT_OPENCL_BLACKLIST:
{
css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLWhiteList);
css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLBlackList);
pValues[nProp] <<= sVal;
}
break;
case SCFORMULAOPT_OPENCL_BLACKLIST:
case SCFORMULAOPT_OPENCL_WHITELIST:
{
css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLBlackList);
css::uno::Sequence<OUString> sVal = SetOfOpenCLImplMatcherToStringSequence(GetCalcConfig().maOpenCLWhiteList);
pValues[nProp] <<= sVal;
}
break;
......
......@@ -30,8 +30,8 @@ typedef enum {
CALC_OPTION_ENABLE_OPENCL_SUBSET,
CALC_OPTION_OPENCL_MIN_SIZE,
CALC_OPTION_OPENCL_SUBSET_OPS,
CALC_OPTION_OPENCL_WHITELIST,
CALC_OPTION_OPENCL_BLACKLIST,
CALC_OPTION_OPENCL_WHITELIST,
} CalcOptionOrder;
class OptionString : public SvLBoxString
......@@ -207,12 +207,12 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
maCaptionOpenCLSubsetOpCodes = get<vcl::Window>("opencl_subset_opcodes")->GetText();
maDescOpenCLSubsetOpCodes = get<vcl::Window>("opencl_subset_opcodes_desc")->GetText();
maCaptionOpenCLWhiteList = get<vcl::Window>("opencl_whitelist")->GetText();
maDescOpenCLWhiteList = get<vcl::Window>("opencl_whitelist_desc")->GetText();
maCaptionOpenCLBlackList = get<vcl::Window>("opencl_blacklist")->GetText();
maDescOpenCLBlackList = get<vcl::Window>("opencl_blacklist_desc")->GetText();
maCaptionOpenCLWhiteList = get<vcl::Window>("opencl_whitelist")->GetText();
maDescOpenCLWhiteList = get<vcl::Window>("opencl_whitelist_desc")->GetText();
maSoftware = get<vcl::Window>("software")->GetText();
mpLbSettings->set_height_request(8 * mpLbSettings->GetTextHeight());
......@@ -378,8 +378,8 @@ void ScCalcOptionsDialog::FillOptionsList()
pModel->Insert(createItem(maCaptionOpenCLSubsetEnabled,toString(maConfig.mbOpenCLSubsetOnly)));
pModel->Insert(createItem(maCaptionOpenCLMinimumFormulaSize,toString(maConfig.mnOpenCLMinimumFormulaGroupSize)));
pModel->Insert(createItem(maCaptionOpenCLSubsetOpCodes,ScOpCodeSetToSymbolicString(maConfig.maOpenCLSubsetOpCodes)));
pModel->Insert(createItem(maCaptionOpenCLWhiteList,""));
pModel->Insert(createItem(maCaptionOpenCLBlackList,""));
pModel->Insert(createItem(maCaptionOpenCLWhiteList,""));
fillOpenCLList();
......@@ -577,8 +577,8 @@ void ScCalcOptionsDialog::SelectionChanged()
break;
// string lists
case CALC_OPTION_OPENCL_WHITELIST:
case CALC_OPTION_OPENCL_BLACKLIST:
case CALC_OPTION_OPENCL_WHITELIST:
{
mpLbOptionEdit->Hide();
mpBtnTrue->Hide();
......@@ -654,8 +654,8 @@ void ScCalcOptionsDialog::ListOptionValueChanged()
case CALC_OPTION_ENABLE_OPENCL_SUBSET:
case CALC_OPTION_OPENCL_MIN_SIZE:
case CALC_OPTION_OPENCL_SUBSET_OPS:
case CALC_OPTION_OPENCL_WHITELIST:
case CALC_OPTION_OPENCL_BLACKLIST:
case CALC_OPTION_OPENCL_WHITELIST:
break;
}
}
......
......@@ -705,10 +705,10 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="opencl_whitelist">
<object class="GtkLabel" id="opencl_blacklist">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">List known-good OpenCL implementations</property>
<property name="label" translatable="yes">List of known-bad OpenCL implementations</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -718,10 +718,10 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="opencl_whitelist_desc">
<object class="GtkLabel" id="opencl_blacklist_desc">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">List of known-good OpenCL implementations.</property>
<property name="label" translatable="yes">List of known-bad OpenCL implementations.</property>
<property name="wrap">True</property>
<property name="max_width_chars">56</property>
</object>
......@@ -733,10 +733,10 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="opencl_blacklist">
<object class="GtkLabel" id="opencl_whitelist">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">List of known-bad OpenCL implementations</property>
<property name="label" translatable="yes">List of known-good OpenCL implementations</property>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -746,10 +746,10 @@
</packing>
</child>
<child>
<object class="GtkLabel" id="opencl_blacklist_desc">
<object class="GtkLabel" id="opencl_whitelist_desc">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">List of known-bad OpenCL implementations.</property>
<property name="label" translatable="yes">List of known-good OpenCL implementations.</property>
<property name="wrap">True</property>
<property name="max_width_chars">56</property>
</object>
......
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