diff --git a/paddle/pten/api/lib/creation.cc b/paddle/pten/api/lib/creation.cc index f39baa0207c73b1d5e9c429748826eba20129224..5745267156cf291e233bf16f6414476d3c29f5f9 100644 --- a/paddle/pten/api/lib/creation.cc +++ b/paddle/pten/api/lib/creation.cc @@ -21,9 +21,16 @@ limitations under the License. */ #include "paddle/pten/api/include/registry.h" #include "paddle/pten/api/lib/kernel_dispatch.h" #include "paddle/pten/api/lib/utils/allocator.h" +#include "paddle/pten/core/kernel_registry.h" #include "paddle/pten/include/core.h" #include "paddle/pten/include/infershape.h" +PT_DECLARE_MODULE(CreationCPU); + +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) +PT_DECLARE_MODULE(CreationCUDA); +#endif + namespace paddle { namespace experimental { diff --git a/paddle/pten/api/lib/linalg.cc b/paddle/pten/api/lib/linalg.cc index 66c7b570b38374360321e46ebd008d6bc9b79047..2ea142be716e652f119b9574f66168580b94fa1a 100644 --- a/paddle/pten/api/lib/linalg.cc +++ b/paddle/pten/api/lib/linalg.cc @@ -24,9 +24,16 @@ limitations under the License. */ #include "paddle/pten/core/convert_utils.h" #include "paddle/pten/core/dense_tensor.h" #include "paddle/pten/core/kernel_context.h" +#include "paddle/pten/core/kernel_registry.h" #include "paddle/pten/include/core.h" #include "paddle/pten/include/infershape.h" +PT_DECLARE_MODULE(LinalgCPU); + +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) +PT_DECLARE_MODULE(LinalgCUDA); +#endif + namespace paddle { namespace experimental { diff --git a/paddle/pten/api/lib/manipulation.cc b/paddle/pten/api/lib/manipulation.cc index 62affde5ec2ca60b4a63ce625e5741ba5c75224e..f3cc647e702ae040ab09fb3f9d92cf7bf5259a64 100644 --- a/paddle/pten/api/lib/manipulation.cc +++ b/paddle/pten/api/lib/manipulation.cc @@ -20,9 +20,16 @@ limitations under the License. */ #include "paddle/pten/api/include/registry.h" #include "paddle/pten/api/lib/kernel_dispatch.h" #include "paddle/pten/api/lib/utils/allocator.h" +#include "paddle/pten/core/kernel_registry.h" #include "paddle/pten/include/core.h" #include "paddle/pten/infermeta/unary.h" +PT_DECLARE_MODULE(ManipulationCPU); + +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) +PT_DECLARE_MODULE(ManipulationCUDA); +#endif + namespace paddle { namespace experimental { diff --git a/paddle/pten/api/lib/math.cc b/paddle/pten/api/lib/math.cc index b86391a3e44df1782081777476d1f9eae7036e47..e5c955b623cb1a0d00ef400515fab95e9d6f27e9 100644 --- a/paddle/pten/api/lib/math.cc +++ b/paddle/pten/api/lib/math.cc @@ -21,10 +21,17 @@ limitations under the License. */ #include "paddle/pten/api/include/registry.h" #include "paddle/pten/api/lib/kernel_dispatch.h" #include "paddle/pten/api/lib/utils/allocator.h" +#include "paddle/pten/core/kernel_registry.h" #include "paddle/pten/include/core.h" #include "paddle/pten/include/infershape.h" #include "paddle/pten/infermeta/unary.h" +PT_DECLARE_MODULE(MathCPU); + +#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) +PT_DECLARE_MODULE(MathCUDA); +#endif + namespace paddle { namespace experimental { diff --git a/paddle/pten/tests/api/test_dot_api.cc b/paddle/pten/tests/api/test_dot_api.cc index 50363a3bf95244a1b3df2af56008a42aba91701a..e9f623096edaf22c1f26b35c0542822a86c31c0f 100644 --- a/paddle/pten/tests/api/test_dot_api.cc +++ b/paddle/pten/tests/api/test_dot_api.cc @@ -21,12 +21,6 @@ limitations under the License. */ #include "paddle/pten/core/dense_tensor.h" #include "paddle/pten/core/kernel_registry.h" -PT_DECLARE_MODULE(LinalgCPU); - -#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) -PT_DECLARE_MODULE(LinalgCUDA); -#endif - namespace framework = paddle::framework; using DDim = paddle::framework::DDim; diff --git a/paddle/pten/tests/api/test_elementwise_api.cc b/paddle/pten/tests/api/test_elementwise_api.cc index 8265624579d3392705b8cce64f9074b5d021183a..e6ac253e1adba466825ede346ce978296f471718 100644 --- a/paddle/pten/tests/api/test_elementwise_api.cc +++ b/paddle/pten/tests/api/test_elementwise_api.cc @@ -21,12 +21,6 @@ limitations under the License. */ #include "paddle/pten/core/dense_tensor.h" #include "paddle/pten/core/kernel_registry.h" -PT_DECLARE_MODULE(MathCPU); - -#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) -PT_DECLARE_MODULE(MathCUDA); -#endif - namespace framework = paddle::framework; using DDim = paddle::framework::DDim; diff --git a/paddle/pten/tests/api/test_fill_api.cc b/paddle/pten/tests/api/test_fill_api.cc index 0b8d0e2e98d84a4e8b3b17ae225e9ae8258f7490..8eb698f73236141f582f3272d0abc9c2a7c5acbd 100644 --- a/paddle/pten/tests/api/test_fill_api.cc +++ b/paddle/pten/tests/api/test_fill_api.cc @@ -21,12 +21,6 @@ limitations under the License. */ #include "paddle/pten/core/dense_tensor.h" #include "paddle/pten/core/kernel_registry.h" -PT_DECLARE_MODULE(CreationCPU); - -#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) -PT_DECLARE_MODULE(CreationCUDA); -#endif - namespace framework = paddle::framework; using DDim = paddle::framework::DDim; diff --git a/paddle/pten/tests/api/test_flatten_api.cc b/paddle/pten/tests/api/test_flatten_api.cc index 5bcf60febff9afb7d9781b969c3bd1f542080b0f..ff4e16ef031a930aa9c42cef48ed2b2312f2bc2c 100644 --- a/paddle/pten/tests/api/test_flatten_api.cc +++ b/paddle/pten/tests/api/test_flatten_api.cc @@ -21,12 +21,6 @@ limitations under the License. */ #include "paddle/pten/core/dense_tensor.h" #include "paddle/pten/core/kernel_registry.h" -PT_DECLARE_MODULE(ManipulationCPU); - -#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) -PT_DECLARE_MODULE(ManipulationCUDA); -#endif - namespace framework = paddle::framework; using DDim = paddle::framework::DDim; diff --git a/paddle/pten/tests/api/test_matmul_api.cc b/paddle/pten/tests/api/test_matmul_api.cc index 377173370de7d9b1f68c389d9b47aba763a15c16..9cf59aa20943f4ee8f5e5e01c245303cf5abbe5f 100644 --- a/paddle/pten/tests/api/test_matmul_api.cc +++ b/paddle/pten/tests/api/test_matmul_api.cc @@ -22,12 +22,6 @@ limitations under the License. */ #include "paddle/pten/core/kernel_registry.h" #include "paddle/pten/kernels/cuda/utils.h" -PT_DECLARE_MODULE(LinalgCPU); - -#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) -PT_DECLARE_MODULE(LinalgCUDA); -#endif - namespace framework = paddle::framework; using DDim = paddle::framework::DDim; diff --git a/paddle/pten/tests/api/test_mean_api.cc b/paddle/pten/tests/api/test_mean_api.cc index ee38e9d49cb1e7a35f07a0550fc94f8053ba62e4..26b6b7301934f97ed8ceea272f5bb9224a52ac6e 100644 --- a/paddle/pten/tests/api/test_mean_api.cc +++ b/paddle/pten/tests/api/test_mean_api.cc @@ -21,12 +21,6 @@ limitations under the License. */ #include "paddle/pten/core/dense_tensor.h" #include "paddle/pten/core/kernel_registry.h" -PT_DECLARE_MODULE(MathCPU); - -#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) -PT_DECLARE_MODULE(MathCUDA); -#endif - namespace framework = paddle::framework; using DDim = paddle::framework::DDim; diff --git a/paddle/pten/tests/api/test_slice_api.cc b/paddle/pten/tests/api/test_slice_api.cc index eb8be21bcbb13b939f9c64dedd150dcd97e5dc15..03d4b1420807ebf9eee1173aead220d96c9d4122 100644 --- a/paddle/pten/tests/api/test_slice_api.cc +++ b/paddle/pten/tests/api/test_slice_api.cc @@ -19,12 +19,6 @@ limitations under the License. */ #include "paddle/pten/api/include/tensor.h" #include "paddle/pten/core/kernel_registry.h" -PT_DECLARE_MODULE(CreationCPU); - -#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) -PT_DECLARE_MODULE(CreationCUDA); -#endif - namespace pten { namespace tests {