From a1eb21e704b570eaf5f5bf571f85ffcc2bc613b0 Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Wed, 5 Dec 2018 12:24:19 +0000 Subject: [PATCH] refine names --- paddle/fluid/operators/jitkernels/CMakeLists.txt | 6 ++++-- paddle/fluid/operators/jitkernels/jitcode/jitcode.h | 2 +- .../operators/jitkernels/{kernels.cc => kernel_pool.cc} | 2 +- .../fluid/operators/jitkernels/{kernels.h => kernel_pool.h} | 0 paddle/fluid/operators/jitkernels/more/mkl/mkl.h | 2 +- paddle/fluid/operators/jitkernels/registry.h | 2 +- paddle/fluid/operators/jitkernels/test.cc | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) rename paddle/fluid/operators/jitkernels/{kernels.cc => kernel_pool.cc} (94%) rename paddle/fluid/operators/jitkernels/{kernels.h => kernel_pool.h} (100%) diff --git a/paddle/fluid/operators/jitkernels/CMakeLists.txt b/paddle/fluid/operators/jitkernels/CMakeLists.txt index e82e6c3026f..f6bb3e0712f 100644 --- a/paddle/fluid/operators/jitkernels/CMakeLists.txt +++ b/paddle/fluid/operators/jitkernels/CMakeLists.txt @@ -7,7 +7,9 @@ set(JIT_KERNEL_DEPS cpu_info cblas gflags enforce place) -cc_library(jit_kernel_base SRCS kernels.cc jitcode_base.cc DEPS ${JIT_KERNEL_DEPS}) +file(GLOB jit_kernel_cc_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.cc") +list(REMOVE_ITEM jit_kernel_cc_srcs jit_test.cc) +cc_library(jit_kernel_base SRCS ${jit_kernel_cc_srcs} DEPS ${JIT_KERNEL_DEPS}) add_subdirectory(refer) add_subdirectory(more) @@ -15,5 +17,5 @@ if(WITH_XBYAK) add_subdirectory(jitcode) endif() -cc_library(jit_kernel SRCS kernels.cc DEPS ${JIT_KERNEL_DEPS}) +cc_library(jit_kernel SRCS ${jit_kernel_cc_srcs} DEPS ${JIT_KERNEL_DEPS}) cc_test(jit_kernel_test SRCS test.cc DEPS jit_kernel) diff --git a/paddle/fluid/operators/jitkernels/jitcode/jitcode.h b/paddle/fluid/operators/jitkernels/jitcode/jitcode.h index a3582e5284c..03c2100ca05 100644 --- a/paddle/fluid/operators/jitkernels/jitcode/jitcode.h +++ b/paddle/fluid/operators/jitkernels/jitcode/jitcode.h @@ -92,7 +92,7 @@ class JitCode : public JitBase, public Xbyak::CodeGenerator { for (int i = 0; i < num_g_abi_regs; ++i) { push(Xbyak::Reg64(g_abi_regs[i])); } - if (platform::jit::MayIUse(platform::jit::avx512f)) { + if (platform::MayIUse(platform::avx512f)) { mov(reg_EVEX_max_8b_offt, 2 * EVEX_max_8b_offt); } } diff --git a/paddle/fluid/operators/jitkernels/kernels.cc b/paddle/fluid/operators/jitkernels/kernel_pool.cc similarity index 94% rename from paddle/fluid/operators/jitkernels/kernels.cc rename to paddle/fluid/operators/jitkernels/kernel_pool.cc index 35095220e39..9bb0ba349bc 100644 --- a/paddle/fluid/operators/jitkernels/kernels.cc +++ b/paddle/fluid/operators/jitkernels/kernel_pool.cc @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "paddle/fluid/operators/jitkernels/kernels.h" +#include "paddle/fluid/operators/jitkernels/kernel_pool.h" #include // for shared_ptr #include #include diff --git a/paddle/fluid/operators/jitkernels/kernels.h b/paddle/fluid/operators/jitkernels/kernel_pool.h similarity index 100% rename from paddle/fluid/operators/jitkernels/kernels.h rename to paddle/fluid/operators/jitkernels/kernel_pool.h diff --git a/paddle/fluid/operators/jitkernels/more/mkl/mkl.h b/paddle/fluid/operators/jitkernels/more/mkl/mkl.h index 7cb4334e503..75ed34ef48e 100644 --- a/paddle/fluid/operators/jitkernels/more/mkl/mkl.h +++ b/paddle/fluid/operators/jitkernels/more/mkl/mkl.h @@ -41,7 +41,7 @@ class VMulKernel VMulKernel() { this->func = VMul; } bool UseMe(int d) const override { if (std::is_same::value) { - return platform::jit::MayIUse(platform::jit::avx512f) && d > 512; + return platform::MayIUse(platform::avx512f) && d > 512; } else { return true; } diff --git a/paddle/fluid/operators/jitkernels/registry.h b/paddle/fluid/operators/jitkernels/registry.h index 62a0de36410..cd414bb096c 100644 --- a/paddle/fluid/operators/jitkernels/registry.h +++ b/paddle/fluid/operators/jitkernels/registry.h @@ -18,7 +18,7 @@ #include #include #include "paddle/fluid/operators/jitkernels/kernel_base.h" -#include "paddle/fluid/operators/jitkernels/kernels.h" +#include "paddle/fluid/operators/jitkernels/kernel_pool.h" #include "paddle/fluid/platform/place.h" #include "paddle/fluid/platform/variant.h" // for UNUSED diff --git a/paddle/fluid/operators/jitkernels/test.cc b/paddle/fluid/operators/jitkernels/test.cc index d11c7afe9ab..eb0d30eecdb 100644 --- a/paddle/fluid/operators/jitkernels/test.cc +++ b/paddle/fluid/operators/jitkernels/test.cc @@ -19,7 +19,7 @@ #include "gflags/gflags.h" #include "glog/logging.h" #include "gtest/gtest.h" -#include "paddle/fluid/operators/jitkernels/kernels.h" +#include "paddle/fluid/operators/jitkernels/kernel_pool.h" // TODO(TJ): remove me #include "paddle/fluid/operators/jitkernels/registry.h" -- GitLab