Closed
Description
Currently, we have four release binaries, no-avx CPU, avx-CPU, no-avx-GPU, avx-GPU.
, which looks quite miscellaneous. Actually, we can check CPU capabilities at runtime via
- query
cpuid
#ifdef _WIN32
/// MSVC CPUID
#define cpuid(info, x) __cpuidex(info, x, 0)
#else
// GCC Intrinsics
#include <cpuid.h>
/// gcc / clang CPUID
#define cpuid(info, x) __cpuid_count(x, 0, info[0], info[1], info[2], info[3])
#endif
- Then, do some bit manipulation to check whether AVX is supported or not.
That can help us decline in number of release binaries from four to two.
- Add SIMD flags source code in
paddle/utils
Add SIMD flags for runtime check #800 - change macro
#if
in current PaddlePaddle to support AVX and SSE at runtime
Metadata
Metadata
Labels
No labels