From 8aa1772cf33170e4dc8fc6566bf60b18598b4bb2 Mon Sep 17 00:00:00 2001 From: huangjiyi <43315610+huangjiyi@users.noreply.github.com> Date: Mon, 4 Sep 2023 11:41:44 +0800 Subject: [PATCH] fix compile errors when using shared phi on windows (#56915) * update * fix bug * fix bug * fix bug * fix bug * rerun ci * turn off shared_phi --- .../fluid/framework/new_executor/interpreter_base_impl.h | 2 +- paddle/fluid/framework/op_kernel_type.h | 2 +- paddle/fluid/imperative/tracer.cc | 2 +- paddle/fluid/imperative/tracer.h | 2 +- paddle/fluid/pybind/eager_method.cc | 2 +- paddle/phi/api/lib/api_gen_utils.cc | 4 ++-- paddle/phi/api/lib/data_transform.cc | 4 ++-- paddle/phi/core/kernel_factory.cc | 9 ++++----- 8 files changed, 13 insertions(+), 14 deletions(-) diff --git a/paddle/fluid/framework/new_executor/interpreter_base_impl.h b/paddle/fluid/framework/new_executor/interpreter_base_impl.h index 88ac481d16c..2c030ef1dc2 100644 --- a/paddle/fluid/framework/new_executor/interpreter_base_impl.h +++ b/paddle/fluid/framework/new_executor/interpreter_base_impl.h @@ -45,7 +45,7 @@ PD_DECLARE_bool(new_executor_use_local_scope); PHI_DECLARE_bool(check_nan_inf); PD_DECLARE_bool(benchmark); -PD_DECLARE_uint64(executor_log_deps_every_microseconds); +PHI_DECLARE_uint64(executor_log_deps_every_microseconds); PHI_DECLARE_bool(new_executor_use_cuda_graph); PHI_DECLARE_bool(enable_new_ir_in_executor); #if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP) diff --git a/paddle/fluid/framework/op_kernel_type.h b/paddle/fluid/framework/op_kernel_type.h index 558ae8f9b90..3bfe90dd6b9 100644 --- a/paddle/fluid/framework/op_kernel_type.h +++ b/paddle/fluid/framework/op_kernel_type.h @@ -26,7 +26,7 @@ limitations under the License. */ #include "paddle/phi/core/kernel_factory.h" #include "paddle/utils/flags.h" -PD_DECLARE_bool(use_stride_kernel); +PHI_DECLARE_bool(use_stride_kernel); namespace paddle { namespace framework { diff --git a/paddle/fluid/imperative/tracer.cc b/paddle/fluid/imperative/tracer.cc index 785e5f2f757..cc00af31e61 100644 --- a/paddle/fluid/imperative/tracer.cc +++ b/paddle/fluid/imperative/tracer.cc @@ -38,7 +38,7 @@ PHI_DECLARE_bool(use_mkldnn); PHI_DECLARE_string(tracer_mkldnn_ops_on); PHI_DECLARE_string(tracer_mkldnn_ops_off); -PD_DECLARE_bool(use_stride_kernel); +PHI_DECLARE_bool(use_stride_kernel); namespace paddle { namespace imperative { diff --git a/paddle/fluid/imperative/tracer.h b/paddle/fluid/imperative/tracer.h index 49b94c743fd..3eced7804c3 100644 --- a/paddle/fluid/imperative/tracer.h +++ b/paddle/fluid/imperative/tracer.h @@ -32,7 +32,7 @@ #include "paddle/fluid/platform/macros.h" #include "paddle/phi/core/compat/arg_map_context.h" -PD_DECLARE_bool(use_stride_kernel); +PHI_DECLARE_bool(use_stride_kernel); namespace paddle { namespace imperative { diff --git a/paddle/fluid/pybind/eager_method.cc b/paddle/fluid/pybind/eager_method.cc index dd99770e05f..5200db761d0 100644 --- a/paddle/fluid/pybind/eager_method.cc +++ b/paddle/fluid/pybind/eager_method.cc @@ -69,7 +69,7 @@ typedef SSIZE_T ssize_t; #include "paddle/utils/pybind.h" PHI_DECLARE_bool(set_to_1d); -PD_DECLARE_bool(use_stride_kernel); +PHI_DECLARE_bool(use_stride_kernel); namespace paddle { namespace pybind { diff --git a/paddle/phi/api/lib/api_gen_utils.cc b/paddle/phi/api/lib/api_gen_utils.cc index 80e169fae10..51875ed9175 100644 --- a/paddle/phi/api/lib/api_gen_utils.cc +++ b/paddle/phi/api/lib/api_gen_utils.cc @@ -13,11 +13,11 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "paddle/phi/api/lib/api_gen_utils.h" +#include "paddle/phi/core/flags.h" #include "paddle/phi/core/visit_type.h" #include "paddle/phi/kernels/strided_copy_kernel.h" -#include "paddle/utils/flags.h" -PD_DECLARE_bool(use_stride_kernel); +PHI_DECLARE_bool(use_stride_kernel); #include "glog/logging.h" diff --git a/paddle/phi/api/lib/data_transform.cc b/paddle/phi/api/lib/data_transform.cc index a8eb379e359..b1559908ebc 100644 --- a/paddle/phi/api/lib/data_transform.cc +++ b/paddle/phi/api/lib/data_transform.cc @@ -21,15 +21,15 @@ limitations under the License. */ #include "paddle/phi/api/lib/utils/allocator.h" #include "paddle/phi/backends/context_pool.h" #include "paddle/phi/core/distributed/auto_parallel/dist_tensor.h" +#include "paddle/phi/core/flags.h" #include "paddle/phi/core/kernel_registry.h" #include "paddle/phi/core/tensor_utils.h" #include "paddle/phi/core/visit_type.h" #include "paddle/phi/kernels/cast_kernel.h" #include "paddle/phi/kernels/contiguous_kernel.h" #include "paddle/phi/kernels/transfer_layout_kernel.h" -#include "paddle/utils/flags.h" -PD_DECLARE_bool(use_stride_kernel); +PHI_DECLARE_bool(use_stride_kernel); namespace paddle { namespace experimental { diff --git a/paddle/phi/core/kernel_factory.cc b/paddle/phi/core/kernel_factory.cc index 3ead251e332..d58decadfad 100644 --- a/paddle/phi/core/kernel_factory.cc +++ b/paddle/phi/core/kernel_factory.cc @@ -25,14 +25,13 @@ #if defined(PADDLE_WITH_CUSTOM_DEVICE) #include "paddle/phi/backends/custom/custom_device_op_list.h" #endif -#include "paddle/fluid/platform/flags.h" #include "paddle/phi/core/compat/op_utils.h" +#include "paddle/phi/core/flags.h" #include "paddle/utils/string/string_helper.h" -PADDLE_DEFINE_EXPORTED_bool( - use_stride_kernel, - true, - "Whether to use strdie kernel if op support stride."); +PHI_DEFINE_EXPORTED_bool(use_stride_kernel, + true, + "Whether to use strdie kernel if op support stride."); PD_DECLARE_int32(low_precision_op_list); PD_DECLARE_bool(enable_api_kernel_fallback); -- GitLab