From d63ece1f764e2e419038ce35c607e821dd87be9a Mon Sep 17 00:00:00 2001 From: Chen Weihang Date: Thu, 17 Feb 2022 13:41:25 +0800 Subject: [PATCH] [PTen] Remove fluid device context deps (#39604) * remove fluid device context deps * fix compile failde --- paddle/pten/core/kernel_utils.h | 4 +++- paddle/pten/kernels/gpu/copy_kernel.cu | 1 + paddle/pten/tests/api/test_matmul_api.cc | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/paddle/pten/core/kernel_utils.h b/paddle/pten/core/kernel_utils.h index 7c611d7eccd..8bc125c50be 100644 --- a/paddle/pten/core/kernel_utils.h +++ b/paddle/pten/core/kernel_utils.h @@ -14,7 +14,9 @@ #pragma once -#include "paddle/pten/backends/all_context.h" +#include "paddle/pten/backends/cpu/cpu_context.h" +#include "paddle/pten/backends/gpu/gpu_context.h" +#include "paddle/pten/backends/xpu/xpu_context.h" #include "paddle/pten/common/scalar.h" #include "paddle/pten/common/scalar_array.h" #include "paddle/pten/core/dense_tensor.h" diff --git a/paddle/pten/kernels/gpu/copy_kernel.cu b/paddle/pten/kernels/gpu/copy_kernel.cu index 5d6229f09f0..21426698d43 100644 --- a/paddle/pten/kernels/gpu/copy_kernel.cu +++ b/paddle/pten/kernels/gpu/copy_kernel.cu @@ -21,6 +21,7 @@ limitations under the License. */ // See Note [ Why still include the fluid headers? ] #include "paddle/fluid/memory/memcpy.h" +#include "paddle/fluid/platform/device_context.h" namespace pten { diff --git a/paddle/pten/tests/api/test_matmul_api.cc b/paddle/pten/tests/api/test_matmul_api.cc index 4d3adf86d16..903ced28c1b 100644 --- a/paddle/pten/tests/api/test_matmul_api.cc +++ b/paddle/pten/tests/api/test_matmul_api.cc @@ -23,6 +23,8 @@ limitations under the License. */ #include "paddle/pten/core/kernel_registry.h" #include "paddle/pten/kernels/copy_kernel.h" +// See Note [ Why still include the fluid headers? ] +#include "paddle/fluid/platform/device_context.h" namespace paddle { namespace tests { -- GitLab