From 10e64565b16276e29675360b3341d811250385ba Mon Sep 17 00:00:00 2001 From: superjomn Date: Sun, 5 May 2019 14:11:41 +0800 Subject: [PATCH] rename OpKernel to KernelLite --- paddle/fluid/lite/core/kernel.h | 8 ++++---- paddle/fluid/lite/core/kernel_test.cc | 2 +- paddle/fluid/lite/core/op_registry.h | 2 +- paddle/fluid/lite/kernels/cuda/io_copy_compute.cc | 4 ++-- paddle/fluid/lite/kernels/cuda/mul_compute.h | 2 +- paddle/fluid/lite/kernels/host/fc_compute.h | 2 +- paddle/fluid/lite/kernels/host/feed_compute.cc | 2 +- paddle/fluid/lite/kernels/host/fetch_compute.cc | 2 +- paddle/fluid/lite/kernels/host/mul_compute.cc | 2 +- paddle/fluid/lite/kernels/host/relu_compute.h | 2 +- paddle/fluid/lite/kernels/host/scale_compute.cc | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/paddle/fluid/lite/core/kernel.h b/paddle/fluid/lite/core/kernel.h index c09158045..bfabd87ba 100644 --- a/paddle/fluid/lite/core/kernel.h +++ b/paddle/fluid/lite/core/kernel.h @@ -150,7 +150,7 @@ class KernelBase { // MKLDNN, plain CUDA C implementations. template -class OpKernel : public KernelBase { +class KernelLite : public KernelBase { public: // Set runtime context. void SetContext(std::unique_ptr&& ctx) { ctx_ = ctx; } @@ -166,15 +166,15 @@ class OpKernel : public KernelBase { void Touch() {} - OpKernel() = default; - virtual ~OpKernel() = default; + KernelLite() = default; + virtual ~KernelLite() = default; protected: std::unique_ptr ctx_; }; template -std::string OpKernel::name() const { +std::string KernelLite::name() const { return op_type() + ":" + TargetToStr(Target) + "/" + PrecisionToStr(Precision) + "/" + DataLayoutToStr(DataLayout); } diff --git a/paddle/fluid/lite/core/kernel_test.cc b/paddle/fluid/lite/core/kernel_test.cc index 045340d04..c41b598a9 100644 --- a/paddle/fluid/lite/core/kernel_test.cc +++ b/paddle/fluid/lite/core/kernel_test.cc @@ -21,7 +21,7 @@ namespace lite { namespace core { int test_code{-1}; -class SomeKernel : public OpKernel { +class SomeKernel : public KernelLite { public: void Run() override { LOG(INFO) << "SomeKernel executed"; diff --git a/paddle/fluid/lite/core/op_registry.h b/paddle/fluid/lite/core/op_registry.h index fb656c3a4..6b8b0e038 100644 --- a/paddle/fluid/lite/core/op_registry.h +++ b/paddle/fluid/lite/core/op_registry.h @@ -52,7 +52,7 @@ class OpLiteRegistor : public Registor { template using KernelRegistryForTarget = - Factory, std::unique_ptr>; + Factory, std::unique_ptr>; class KernelRegistry final { public: diff --git a/paddle/fluid/lite/kernels/cuda/io_copy_compute.cc b/paddle/fluid/lite/kernels/cuda/io_copy_compute.cc index 01b62374d..493c8a918 100644 --- a/paddle/fluid/lite/kernels/cuda/io_copy_compute.cc +++ b/paddle/fluid/lite/kernels/cuda/io_copy_compute.cc @@ -42,7 +42,7 @@ void CopyToHostSync(void* target, const void* source, size_t size) { * This kernel copies a tensor from host to CUDA space. */ class IoCopyHostToCudaCompute - : public OpKernel { + : public KernelLite { public: void Run() override { auto& param = Param(); @@ -77,7 +77,7 @@ class IoCopyHostToCudaCompute * This kernel copies a tensor from CUDA to host space. */ class IoCopyCudaToHostCompute - : public OpKernel { + : public KernelLite { public: void Run() override { auto& param = Param(); diff --git a/paddle/fluid/lite/kernels/cuda/mul_compute.h b/paddle/fluid/lite/kernels/cuda/mul_compute.h index b7419e99e..4b5998fd2 100644 --- a/paddle/fluid/lite/kernels/cuda/mul_compute.h +++ b/paddle/fluid/lite/kernels/cuda/mul_compute.h @@ -30,7 +30,7 @@ void mul_compute(const lite::cuda::Blas& blas, const T* x, int x_h, nullptr, out, x_h); } -class MulCompute : public OpKernel { +class MulCompute : public KernelLite { public: using param_t = operators::MulParam; diff --git a/paddle/fluid/lite/kernels/host/fc_compute.h b/paddle/fluid/lite/kernels/host/fc_compute.h index d835e96d4..78710c120 100644 --- a/paddle/fluid/lite/kernels/host/fc_compute.h +++ b/paddle/fluid/lite/kernels/host/fc_compute.h @@ -23,7 +23,7 @@ namespace lite { namespace kernels { namespace host { -class FcCompute : public OpKernel { +class FcCompute : public KernelLite { public: using param_t = operators::FcParam; diff --git a/paddle/fluid/lite/kernels/host/feed_compute.cc b/paddle/fluid/lite/kernels/host/feed_compute.cc index b1cef7327..0df9e8f42 100644 --- a/paddle/fluid/lite/kernels/host/feed_compute.cc +++ b/paddle/fluid/lite/kernels/host/feed_compute.cc @@ -21,7 +21,7 @@ namespace kernels { namespace host { class FeedCompute - : public OpKernel { + : public KernelLite { public: using param_t = operators::FeedParam; diff --git a/paddle/fluid/lite/kernels/host/fetch_compute.cc b/paddle/fluid/lite/kernels/host/fetch_compute.cc index 4d640feff..e23b540e6 100644 --- a/paddle/fluid/lite/kernels/host/fetch_compute.cc +++ b/paddle/fluid/lite/kernels/host/fetch_compute.cc @@ -21,7 +21,7 @@ namespace kernels { namespace host { class FetchCompute - : public OpKernel { + : public KernelLite { public: using param_t = operators::FeedParam; diff --git a/paddle/fluid/lite/kernels/host/mul_compute.cc b/paddle/fluid/lite/kernels/host/mul_compute.cc index 2f6a95c83..9a61ffaa1 100644 --- a/paddle/fluid/lite/kernels/host/mul_compute.cc +++ b/paddle/fluid/lite/kernels/host/mul_compute.cc @@ -35,7 +35,7 @@ void mul_compute_eigen(const T* x, int x_h, int x_w, const T* y, int y_h, Out = X * Y; } -class MulCompute : public OpKernel { +class MulCompute : public KernelLite { public: using param_t = operators::MulParam; diff --git a/paddle/fluid/lite/kernels/host/relu_compute.h b/paddle/fluid/lite/kernels/host/relu_compute.h index 8afe18191..eec420e74 100644 --- a/paddle/fluid/lite/kernels/host/relu_compute.h +++ b/paddle/fluid/lite/kernels/host/relu_compute.h @@ -21,7 +21,7 @@ namespace lite { namespace kernels { namespace host { -class ReluCompute : public OpKernel { +class ReluCompute : public KernelLite { public: void Run() override { auto& theparam = Param(); diff --git a/paddle/fluid/lite/kernels/host/scale_compute.cc b/paddle/fluid/lite/kernels/host/scale_compute.cc index 4b260aecf..b17498a36 100644 --- a/paddle/fluid/lite/kernels/host/scale_compute.cc +++ b/paddle/fluid/lite/kernels/host/scale_compute.cc @@ -31,7 +31,7 @@ void scale_compute(const T* x, T* out, int size, float scale, float bias, } } -class ScaleCompute : public OpKernel { +class ScaleCompute : public KernelLite { public: using param_t = operators::MulParam; -- GitLab