Skip to content

Commit 4e538db

Browse files
committed
refine jit space
1 parent 5ca0bb9 commit 4e538db

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

paddle/fluid/platform/cpu_info.cc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ size_t CUDAPinnedMaxChunkSize() {
103103
return CUDAPinnedMaxAllocSize() / 256;
104104
}
105105

106-
#ifdef PADDLE_WITH_XBYAK
107106
namespace jit {
108-
107+
#ifdef PADDLE_WITH_XBYAK
109108
static Xbyak::util::Cpu cpu;
110109
bool MayIUse(const cpu_isa_t cpu_isa) {
111110
using namespace Xbyak::util; // NOLINT
@@ -136,8 +135,16 @@ bool MayIUse(const cpu_isa_t cpu_isa) {
136135
}
137136
return false;
138137
}
138+
#else
139+
bool MayIUse(const cpu_isa_t cpu_isa) {
140+
if (cpu_isa == isa_any) {
141+
return true;
142+
} else {
143+
return false;
144+
}
145+
}
146+
#endif
139147

140148
} // namespace jit
141-
#endif
142149
} // namespace platform
143150
} // namespace paddle

paddle/fluid/platform/cpu_info.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ size_t CUDAPinnedMinChunkSize();
3737
//! Get the maximum chunk size for buddy allocator.
3838
size_t CUDAPinnedMaxChunkSize();
3939

40-
#ifdef PADDLE_WITH_XBYAK
4140
namespace jit {
42-
4341
typedef enum {
4442
isa_any,
4543
sse42,
@@ -56,7 +54,6 @@ typedef enum {
5654
inline bool MayIUse(const cpu_isa_t cpu_isa);
5755

5856
} // namespace jit
59-
#endif
6057

6158
} // namespace platform
6259
} // namespace paddle

0 commit comments

Comments
 (0)