Skip to content

Commit 3d5a990

Browse files
authored
Merge pull request #14298 from tensor-tang/fix/mac
fix run error on mac
2 parents 2466ca1 + 3319072 commit 3d5a990

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

paddle/fluid/operators/math/jit_kernel_test.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,11 @@ TEST(JitKernel, pool) {
801801
std::dynamic_pointer_cast<const jit::Kernel>(pvmul_d));
802802

803803
const auto& pvmul_from_key = jit::KernelPool::Instance().Get("vmulfjit4");
804-
EXPECT_EQ(pvmul_f, pvmul_from_key);
804+
#if defined(__APPLE__) || defined(__OSX__) || defined(_WIN32)
805+
EXPECT_EQ(pvmul_from_key, nullptr);
806+
#else
807+
EXPECT_EQ(pvmul_from_key, pvmul_f);
808+
#endif
805809
const auto& pvmul_from_key2 = jit::KernelPool::Instance().Get("vmulfjit");
806810
EXPECT_TRUE(pvmul_from_key2 == nullptr);
807811
}

paddle/fluid/platform/init.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ void InitDevices(bool init_p2p, const std::vector<int> devices) {
116116
platform::SetNumThreads(FLAGS_paddle_num_threads);
117117
#endif
118118

119+
#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__OSX__)
119120
if (platform::jit::MayIUse(platform::jit::avx)) {
120121
#ifndef __AVX__
121122
LOG(WARNING) << "AVX is available, Please re-compile on local machine";
@@ -157,8 +158,9 @@ void InitDevices(bool init_p2p, const std::vector<int> devices) {
157158
AVX_GUIDE(AVX, NonAVX);
158159
}
159160
#endif
160-
161161
#undef AVX_GUIDE
162+
163+
#endif
162164
}
163165

164166
void InitGLOG(const std::string &prog_name) {

0 commit comments

Comments
 (0)