提交 4e538db1 编写于 作者: T tensor-tang

refine jit space

上级 5ca0bb9a
...@@ -103,9 +103,8 @@ size_t CUDAPinnedMaxChunkSize() { ...@@ -103,9 +103,8 @@ size_t CUDAPinnedMaxChunkSize() {
return CUDAPinnedMaxAllocSize() / 256; return CUDAPinnedMaxAllocSize() / 256;
} }
#ifdef PADDLE_WITH_XBYAK
namespace jit { namespace jit {
#ifdef PADDLE_WITH_XBYAK
static Xbyak::util::Cpu cpu; static Xbyak::util::Cpu cpu;
bool MayIUse(const cpu_isa_t cpu_isa) { bool MayIUse(const cpu_isa_t cpu_isa) {
using namespace Xbyak::util; // NOLINT using namespace Xbyak::util; // NOLINT
...@@ -136,8 +135,16 @@ bool MayIUse(const cpu_isa_t cpu_isa) { ...@@ -136,8 +135,16 @@ bool MayIUse(const cpu_isa_t cpu_isa) {
} }
return false; return false;
} }
#else
bool MayIUse(const cpu_isa_t cpu_isa) {
if (cpu_isa == isa_any) {
return true;
} else {
return false;
}
}
#endif
} // namespace jit } // namespace jit
#endif
} // namespace platform } // namespace platform
} // namespace paddle } // namespace paddle
...@@ -37,9 +37,7 @@ size_t CUDAPinnedMinChunkSize(); ...@@ -37,9 +37,7 @@ size_t CUDAPinnedMinChunkSize();
//! Get the maximum chunk size for buddy allocator. //! Get the maximum chunk size for buddy allocator.
size_t CUDAPinnedMaxChunkSize(); size_t CUDAPinnedMaxChunkSize();
#ifdef PADDLE_WITH_XBYAK
namespace jit { namespace jit {
typedef enum { typedef enum {
isa_any, isa_any,
sse42, sse42,
...@@ -56,7 +54,6 @@ typedef enum { ...@@ -56,7 +54,6 @@ typedef enum {
inline bool MayIUse(const cpu_isa_t cpu_isa); inline bool MayIUse(const cpu_isa_t cpu_isa);
} // namespace jit } // namespace jit
#endif
} // namespace platform } // namespace platform
} // namespace paddle } // namespace paddle
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册