未验证 提交 a762d68e 编写于 作者: H hong 提交者: GitHub

remove avx check (#48003)

* remove avx check

* fix bug;
上级 2f8901cb
......@@ -285,52 +285,6 @@ void InitDevices(const std::vector<int> devices) {
#ifndef PADDLE_WITH_MKLDNN
platform::SetNumThreads(FLAGS_paddle_num_threads);
#endif
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OSX__)
if (platform::MayIUse(platform::avx)) {
#ifndef __AVX__
LOG(WARNING) << "AVX is available, Please re-compile on local machine";
#endif
}
// Throw some informations when CPU instructions mismatch.
#define AVX_GUIDE(compiletime, runtime) \
PADDLE_THROW(platform::errors::Unavailable( \
"This version is compiled on higher instruction(" #compiletime \
") system, you may encounter illegal instruction error running on" \
" your local CPU machine. Please reinstall the " #runtime \
" version or compile from source code."))
#ifdef __AVX512F__
if (!platform::MayIUse(platform::avx512f)) {
if (platform::MayIUse(platform::avx2)) {
AVX_GUIDE(AVX512, AVX2);
} else if (platform::MayIUse(platform::avx)) {
AVX_GUIDE(AVX512, AVX);
} else {
AVX_GUIDE(AVX512, NonAVX);
}
}
#endif
#ifdef __AVX2__
if (!platform::MayIUse(platform::avx2)) {
if (platform::MayIUse(platform::avx)) {
AVX_GUIDE(AVX2, AVX);
} else {
AVX_GUIDE(AVX2, NonAVX);
}
}
#endif
#ifdef __AVX__
if (!platform::MayIUse(platform::avx)) {
AVX_GUIDE(AVX, NonAVX);
}
#endif
#undef AVX_GUIDE
#endif
}
#ifndef _WIN32
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册