Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2618)

Unified Diff: base/cpu.h

Issue 12049058: Adds AVX detection to CPU and records a histogram of Intel uArch Support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing feedback Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/cpu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/cpu.h
diff --git a/base/cpu.h b/base/cpu.h
index 957b1a564c9a6b23a03f9a56d1972d586240e4df..65fda47950c9dae97dcd9a288d3d65c2affac79b 100644
--- a/base/cpu.h
+++ b/base/cpu.h
@@ -17,6 +17,18 @@ class BASE_EXPORT CPU {
// Constructor
CPU();
+ enum IntelMicroArchitecture {
+ PENTIUM,
+ SSE,
+ SSE2,
+ SSE3,
+ SSSE3,
+ SSE41,
+ SSE42,
+ AVX,
+ MAX_INTEL_MICRO_ARCHITECTURE
+ };
+
// Accessors for CPU information.
const std::string& vendor_name() const { return cpu_vendor_; }
int stepping() const { return stepping_; }
@@ -32,6 +44,8 @@ class BASE_EXPORT CPU {
bool has_ssse3() const { return has_ssse3_; }
bool has_sse41() const { return has_sse41_; }
bool has_sse42() const { return has_sse42_; }
+ bool has_avx() const { return has_avx_; }
+ IntelMicroArchitecture GetIntelMicroArchitecture() const;
const std::string& cpu_brand() const { return cpu_brand_; }
private:
@@ -51,6 +65,7 @@ class BASE_EXPORT CPU {
bool has_ssse3_;
bool has_sse41_;
bool has_sse42_;
+ bool has_avx_;
std::string cpu_vendor_;
std::string cpu_brand_;
};
« no previous file with comments | « no previous file | base/cpu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698