提交 0b4f742e 编写于 作者: P peizhilin

fix the build issue

test=develop
上级 da42cf20
...@@ -83,8 +83,12 @@ class ElementwiseMulMKLDNNKernel : public framework::OpKernel<T> { ...@@ -83,8 +83,12 @@ class ElementwiseMulMKLDNNKernel : public framework::OpKernel<T> {
UpdateDataFormat(ctx, const_cast<Tensor*>(x), "x_data_format"); UpdateDataFormat(ctx, const_cast<Tensor*>(x), "x_data_format");
UpdateDataFormat(ctx, const_cast<Tensor*>(y), "y_data_format"); UpdateDataFormat(ctx, const_cast<Tensor*>(y), "y_data_format");
#ifdef PADDLE_WITH_XBYAK
Xbyak::util::Cpu cpu; Xbyak::util::Cpu cpu;
const bool is_avx512_enabled = cpu.has(Xbyak::util::Cpu::tAVX512F); const bool is_avx512_enabled = cpu.has(Xbyak::util::Cpu::tAVX512F);
#else
const bool is_avx512_enabled = platform::MayIUse(platform::avx512f);
#endif // PADDLE_WITH_XBYAK
const bool are_dims_divisable = !(x_int_dims[1] % 16); const bool are_dims_divisable = !(x_int_dims[1] % 16);
const bool is_x_format_correct = x->format() == memory::format::nChw16c; const bool is_x_format_correct = x->format() == memory::format::nChw16c;
const bool is_y_format_correct = y->format() == memory::format::nc; const bool is_y_format_correct = y->format() == memory::format::nc;
......
...@@ -17,6 +17,12 @@ limitations under the License. */ ...@@ -17,6 +17,12 @@ limitations under the License. */
#include "paddle/fluid/operators/math/detail/activation_functions.h" #include "paddle/fluid/operators/math/detail/activation_functions.h"
#include "paddle/fluid/operators/math/lstm_compute.h" #include "paddle/fluid/operators/math/lstm_compute.h"
#if defined(_WIN32)
#if defined(__AVX2__) || defined(__AVX__)
inline __m256 operator+=(__m256 a, __m256 b) { return _mm256_add_ps(a, b); }
#endif
#endif
namespace paddle { namespace paddle {
namespace operators { namespace operators {
namespace math { namespace math {
......
...@@ -212,8 +212,10 @@ class EltwiseMulnChw16cNCKernelImpl ...@@ -212,8 +212,10 @@ class EltwiseMulnChw16cNCKernelImpl
private: private:
std::unique_ptr<gen::EltwiseMulnChw16cNC> jitcode_{nullptr}; std::unique_ptr<gen::EltwiseMulnChw16cNC> jitcode_{nullptr};
#endif
}; };
#ifdef PADDLE_WITH_XBYAK
template <> template <>
bool EltwiseMulnChw16cNCKernelImpl<float>::useJIT(int d) { bool EltwiseMulnChw16cNCKernelImpl<float>::useJIT(int d) {
return true; return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册