diff --git a/paddle/fluid/lite/core/kernel.h b/paddle/fluid/lite/core/kernel.h index c09158045c5520728cbea81df4c32c1435fa862d..bfabd87baff0a7584644322dd096c60b7b3e3a61 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 045340d04a04e2fea3f6d67189df5d0d2f9661ff..c41b598a9fee93f13aa79479e108a2f5431fee62 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 fb656c3a4ca3645aecbf2e64ba2ffa818c8b872a..6b8b0e038719cc2ea1fcc8a75278a91b14dd10c0 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 01b62374df925be1d7317d347c998c03fbffe6f7..493c8a9181ef299e72b6e905dfb23c96c53b51cc 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 b7419e99ede808293d966ced6819c67688ad8cce..4b5998fd2fb9e9ea08de9951d78ebc676204a51b 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 d835e96d4093a5173190e2e0929bb2180404d74c..78710c1202d58560ab04a8028b4e311e966b60ce 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 b1cef73276b2da8287ff12c5bba4130478a2c004..0df9e8f429da20021dd9f450b20b07fe88171525 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 4d640feff3744bf5eb8eb0447eb1b2ccd30cae9f..e23b540e6441efd14f082bf72a2d37982cdf6894 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 2f6a95c83ba978da718ba58bd4c5e3f8dbc5f69a..9a61ffaa1c5463a8794ba5016ec019a3b4baea7f 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 8afe1819184eb71a520ce1278bfe384752e42966..eec420e74bf2ce02fd9a201b03e2a3f771d70ff4 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 4b260aecf87cbafbef32104bbecab7686c1b4642..b17498a3612b8217c5e65a758b3aef717559d1d7 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;