mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
Add support for checking for F16C support (https://en.wikipedia.org/wiki/F16C). (#212)
This commit is contained in:
parent
ab350fa4c7
commit
0248390e4d
2 changed files with 3 additions and 0 deletions
|
|
@ -56,6 +56,7 @@ CPUIDInfo::CPUIDInfo() noexcept {
|
|||
int value = XGETBV();
|
||||
bool has_avx = (data[2] & (1 << 28)) && ((value & AVX_MASK) == AVX_MASK);
|
||||
bool has_avx512 = (value & AVX512_MASK) == AVX512_MASK;
|
||||
has_f16c_ = has_avx && (data[2] & (1 << 29)) && (data[3] & (1 << 26));
|
||||
|
||||
if (num_IDs >= 7) {
|
||||
GetCPUID(7, data);
|
||||
|
|
|
|||
|
|
@ -14,11 +14,13 @@ public:
|
|||
|
||||
bool HasAVX2() const { return has_avx2_; }
|
||||
bool HasAVX512f() const { return has_avx512f_; }
|
||||
bool HasF16C() const { return has_f16c_; }
|
||||
|
||||
private:
|
||||
CPUIDInfo() noexcept;
|
||||
bool has_avx2_{false};
|
||||
bool has_avx512f_{false};
|
||||
bool has_f16c_{false};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue