mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
ts: test case list is printed after cmd line parsing, refactored
This commit is contained in:
@@ -457,6 +457,18 @@ Returns empty string if feature is not defined
|
||||
*/
|
||||
CV_EXPORTS_W String getHardwareFeatureName(int feature);
|
||||
|
||||
/** @brief Returns list of CPU features enabled during compilation.
|
||||
|
||||
Returned value is a string containing space separated list of CPU features with following markers:
|
||||
|
||||
- no markers - baseline features
|
||||
- prefix `*` - features enabled in dispatcher
|
||||
- suffix `?` - features enabled but not available in HW
|
||||
|
||||
Example: `SSE SSE2 SSE3 *SSE4.1 *SSE4.2 *FP16 *AVX *AVX2 *AVX512-SKX?`
|
||||
*/
|
||||
CV_EXPORTS std::string getCPUFeaturesLine();
|
||||
|
||||
/** @brief Returns the number of logical CPUs available for the process.
|
||||
*/
|
||||
CV_EXPORTS_W int getNumberOfCPUs();
|
||||
|
||||
@@ -654,6 +654,27 @@ String getHardwareFeatureName(int feature)
|
||||
return name ? String(name) : String();
|
||||
}
|
||||
|
||||
std::string getCPUFeaturesLine()
|
||||
{
|
||||
const int features[] = { CV_CPU_BASELINE_FEATURES, CV_CPU_DISPATCH_FEATURES };
|
||||
const int sz = sizeof(features) / sizeof(features[0]);
|
||||
std::string result;
|
||||
std::string prefix;
|
||||
for (int i = 1; i < sz; ++i)
|
||||
{
|
||||
if (features[i] == 0)
|
||||
{
|
||||
prefix = "*";
|
||||
continue;
|
||||
}
|
||||
if (i != 1) result.append(" ");
|
||||
result.append(prefix);
|
||||
result.append(getHWFeatureNameSafe(features[i]));
|
||||
if (!checkHardwareSupport(features[i])) result.append("?");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
volatile bool useOptimizedFlag = true;
|
||||
|
||||
void setUseOptimized( bool flag )
|
||||
|
||||
Reference in New Issue
Block a user