MCPcopy Create free account
hub / github.com/cwida/FastLanes / Initialize

Method Initialize

src/utl/cpu/info.cpp:89–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 best_feature = CPUFeature::FALLBACK;
88 avail_features.push_back(CPUFeature::FALLBACK);
89
90 CpuInit();
91
92#ifdef X86_64
93 // Simple rule, the wider better.
94 if (CpuFeatureCheck(CPU_FEATURE_X86_AVX2)) {
95 best_feature = CPU_FEATURE_X86_AVX2;
96 avail_features.push_back(CPU_FEATURE_X86_AVX2);
97 }
98 if (CpuFeatureCheck(CPU_FEATURE_X86_AVX512F)) {
99 best_feature = CPU_FEATURE_X86_AVX512F;
100 avail_features.push_back(CPU_FEATURE_X86_AVX512F);
101 }
102#elif defined(ARM)
103#endif
104}
105CPUFeature CpuInfo::GetBestFeature() const { return best_feature; }
106
107bool CpuInfo::HasFeature(CPUFeature feature) {
108 if (feature == CPUFeature::FALLBACK) { return true; }
109 return CpuFeatureCheck(feature);
110}
111
112bool CpuInfo::HasFeature(const std::string& feature) {

Callers

nothing calls this directly

Calls 3

CpuFeatureCheckFunction · 0.85
CpuInitFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected