diff options
author | Frank Seide <fseide@microsoft.com> | 2019-09-14 03:17:20 +0300 |
---|---|---|
committer | Frank Seide <fseide@microsoft.com> | 2019-09-14 03:17:20 +0300 |
commit | d53e6d709a598aa6e5ec583968f938a79788fdfb (patch) | |
tree | c5aaf675b3ca69e88efec169bbb74ee00fdb81ac | |
parent | 49e8018ab2397c175354317b35c6be6dd68f8932 (diff) |
fixed a build error for non-AVX2 builds
-rwxr-xr-x[-rw-r--r--] | src/QuantUtilsAvx2.cc | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | src/Utils.cc | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/QuantUtilsAvx2.cc b/src/QuantUtilsAvx2.cc index 7f43ced..6371b6f 100644..100755 --- a/src/QuantUtilsAvx2.cc +++ b/src/QuantUtilsAvx2.cc @@ -257,6 +257,11 @@ void RequantizeFixedPointAvx2( dst[i] = std::min<int64_t>(std::max<int64_t>(quantized_down, 0l), 255l); } } +#else +// dummy implementation to avoid link errors +void RequantizeFixedPointAvx2(const int32_t* src, uint8_t* dst, int len, const RequantizationParams& params) { + assert(false && "RequantizeFixedPointAvx2() called in build without AVX2 support"); +} #endif template < diff --git a/src/Utils.cc b/src/Utils.cc index 355a5cb..99f8125 100644..100755 --- a/src/Utils.cc +++ b/src/Utils.cc @@ -202,8 +202,12 @@ bool fbgemmHasAvx512Support() { cpuinfo_has_x86_avx512dq() && cpuinfo_has_x86_avx512vl()); } +#ifdef __AVX2__ bool fbgemmHasAvx2Support() { return (cpuinfo_initialize() && cpuinfo_has_x86_avx2()); } +#else +bool fbgemmHasAvx2Support() { return false; } +#endif } // namespace fbgemm |