Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Inference] refine common/*.h for inference lib #60513

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cmake/inference_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,6 @@ copy(
inference_lib_dist
SRCS ${PADDLE_SOURCE_DIR}/paddle/phi/core/visit_type.h
DSTS ${PADDLE_INFERENCE_INSTALL_DIR}/paddle/include/paddle/phi/core/)
copy(
inference_lib_dist
SRCS ${PADDLE_SOURCE_DIR}/paddle/phi/core/hostdevice.h
DSTS ${PADDLE_INFERENCE_INSTALL_DIR}/paddle/include/paddle/phi/core/)
copy(
inference_lib_dist
SRCS ${PADDLE_SOURCE_DIR}/paddle/fluid/platform/init_phi.h
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/bernoulli_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License. */

#pragma once
#include "paddle/common/hostdevice.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/phi/core/hostdevice.h"

namespace paddle {
namespace operators {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/bilateral_slice_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include <string>
#include <vector>

#include "paddle/common/hostdevice.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/phi/core/hostdevice.h"

namespace paddle {
namespace operators {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/dequantize_log_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License. */

#include "paddle/fluid/operators/dequantize_log_op.h"
#include "paddle/common/hostdevice.h"
#include "paddle/phi/backends/gpu/gpu_primitives.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/kernels/funcs/math.h"

namespace paddle {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/detection/box_clip_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ limitations under the License. */

#include <algorithm>

#include "paddle/common/hostdevice.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/operators/detection/box_clip_op.h"
#include "paddle/phi/backends/gpu/gpu_primitives.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/kernels/funcs/math_function.h"

namespace paddle {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/fake_quantize_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ limitations under the License. */

#include <string>

#include "paddle/common/hostdevice.h"
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/tensor_util.h"
#include "paddle/fluid/memory/malloc.h"
#include "paddle/phi/common/transform.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/kernels/funcs/blas/blas.h"

namespace paddle {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/index_impl.cu.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ limitations under the License. */
#include <thrust/host_vector.h>
#include <thrust/random.h>

#include "paddle/common/hostdevice.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/operator.h"
#include "paddle/phi/backends/gpu/gpu_launch_config.h"
#include "paddle/phi/common/amp_type_traits.h"
#include "paddle/phi/core/generator.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/kernels/funcs/aligned_vector.h"
#include "paddle/phi/kernels/funcs/distribution_helper.h"
#include "paddle/phi/kernels/primitive/kernel_primitives.h"
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/interpolate_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <string>
#include <vector>

#include "paddle/common/hostdevice.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/kernels/funcs/eigen/common.h"
#include "paddle/phi/kernels/funcs/math_function.h"

Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/math/cos_sim_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ limitations under the License. */
#include <math.h>
#include <stdlib.h>

#include "paddle/common/hostdevice.h"
#include "paddle/fluid/platform/device_context.h"
#include "paddle/phi/core/hostdevice.h"

namespace paddle {
namespace operators {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/modified_huber_loss_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ limitations under the License. */
#include <thrust/host_vector.h>
#include <thrust/tuple.h>

#include "paddle/common/hostdevice.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/operators/modified_huber_loss_op.h"
#include "paddle/phi/core/hostdevice.h"

namespace paddle {
namespace operators {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/modified_huber_loss_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ limitations under the License. */

#pragma once

#include "paddle/common/hostdevice.h"
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/phi/core/hostdevice.h"

namespace paddle {
namespace operators {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/quantize_linear_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ limitations under the License. */
#include <vector>

#include "paddle/common/ddim.h"
#include "paddle/common/hostdevice.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/tensor_util.h"
#include "paddle/fluid/memory/malloc.h"
#include "paddle/fluid/operators/fake_quantize_op.h"
#include "paddle/phi/common/data_type.h"
#include "paddle/phi/common/transform.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/kernels/cast_kernel.h"

namespace paddle {
Expand Down
7 changes: 5 additions & 2 deletions paddle/phi/api/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ limitations under the License. */
#include "paddle/phi/api/include/tensor_utils.h"

// phi common headers
#include "paddle/common/layout.h"
#include "paddle/phi/common/backend.h"
#include "paddle/phi/common/data_type.h"
#include "paddle/phi/common/int_array.h"
#include "paddle/phi/common/scalar.h"

// original custom op headers
#include "paddle/common/exception.h"
#include "paddle/phi/api/ext/dispatch.h"
#include "paddle/phi/api/ext/op_meta_info.h"
#include "paddle/phi/api/ext/tensor_compat.h"

// common headers
#include "paddle/common/ddim.h"
#include "paddle/common/exception.h"
#include "paddle/common/layout.h"
2 changes: 1 addition & 1 deletion paddle/phi/common/bfloat16.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <cstring>
#include <iostream>
#include <limits>
#include "paddle/phi/core/hostdevice.h"
#include "paddle/common/hostdevice.h"

#ifdef PADDLE_WITH_CUDA
#include <cuda.h>
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/common/complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <cstring>
#include <iostream>
#include <limits>
#include "paddle/phi/core/hostdevice.h"
#include "paddle/common/hostdevice.h"
#ifdef PADDLE_WITH_CUDA
#include <cuComplex.h>
#include <thrust/complex.h>
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/common/float16.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <iostream>
#include <limits>

#include "paddle/phi/core/hostdevice.h"
#include "paddle/common/hostdevice.h"
#ifdef PADDLE_WITH_CUDA
#include <cuda.h>
#endif // PADDLE_WITH_CUDA
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/common/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ limitations under the License. */
#include <algorithm>
#include <type_traits>

#include "paddle/common/hostdevice.h"
#include "paddle/phi/backends/all_context.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/core/hostdevice.h"

#if defined(__NVCC__) || defined(__HIPCC__)
#include <thrust/execution_policy.h>
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/common/type_safe_sign_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include <cmath>
#include <type_traits>

#include "paddle/common/hostdevice.h"
#include "paddle/phi/common/bfloat16.h"
#include "paddle/phi/common/float16.h"
#include "paddle/phi/core/hostdevice.h"

namespace phi {

Expand Down
37 changes: 0 additions & 37 deletions paddle/phi/core/hostdevice.h

This file was deleted.

2 changes: 1 addition & 1 deletion paddle/phi/kernels/cpu/graph_send_recv_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#include <algorithm>
#include <vector>

#include "paddle/common/hostdevice.h"
#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/kernels/funcs/eigen/common.h"

namespace phi {
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/cpu/graph_send_ue_recv_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#include <algorithm>
#include <vector>

#include "paddle/common/hostdevice.h"
#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/kernels/funcs/eigen/common.h"

namespace phi {
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/cpu/send_u_recv_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <set>
#include <vector>

#include "paddle/common/hostdevice.h"
#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/cpu/graph_send_recv_funcs.h"

Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/cpu/send_ue_recv_grad_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include <algorithm>
#include <vector>

#include "paddle/common/hostdevice.h"
#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/cpu/graph_send_recv_funcs.h"
#include "paddle/phi/kernels/cpu/graph_send_ue_recv_funcs.h"
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/cpu/send_ue_recv_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <set>
#include <vector>

#include "paddle/common/hostdevice.h"
#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/cpu/graph_send_ue_recv_funcs.h"
#include "paddle/phi/kernels/impl/graph_message_passing_impl.h"
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/cpu/send_uv_grad_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include "paddle/phi/kernels/send_uv_grad_kernel.h"

#include "paddle/common/hostdevice.h"
#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/empty_kernel.h"
#include "paddle/phi/kernels/funcs/math_function.h"
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/cpu/send_uv_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#include "paddle/phi/kernels/send_uv_kernel.h"

#include "paddle/common/hostdevice.h"
#include "paddle/phi/backends/cpu/cpu_context.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/cpu/graph_send_ue_recv_funcs.h"
#include "paddle/phi/kernels/impl/graph_message_passing_impl.h"
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/funcs/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <cstdint> // for int64_t
#include <numeric>

#include "paddle/phi/core/hostdevice.h"
#include "paddle/common/hostdevice.h"

namespace phi {
namespace funcs {
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/funcs/aligned_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ limitations under the License. */

#include <algorithm>

#include "paddle/common/hostdevice.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/hostdevice.h"

#if defined(__xpu__)
#define CHAR_BIT 8
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/funcs/complex_functors.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ limitations under the License. */
#include <cmath>
#include <type_traits>

#include "paddle/common/hostdevice.h"
#include "paddle/phi/common/complex.h"
#include "paddle/phi/common/type_traits.h"
#include "paddle/phi/core/hostdevice.h"

namespace phi {
namespace funcs {
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/funcs/cross_entropy.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ limitations under the License. */
#pragma once
#include <limits>

#include "paddle/common/hostdevice.h"
#include "paddle/phi/common/bfloat16.h"
#include "paddle/phi/common/float16.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/kernels/funcs/eigen/common.h"

namespace phi {
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/funcs/detail/activation_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ limitations under the License. */
#include <stdexcept>
#include <string>

#include "paddle/common/hostdevice.h"
#include "paddle/common/macros.h"
#include "paddle/phi/backends/cpu/cpu_info.h"
#include "paddle/phi/core/hostdevice.h"
namespace phi {
namespace funcs {
namespace detail {
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/funcs/detail/gru_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include <type_traits>

#include "paddle/phi/core/hostdevice.h"
#include "paddle/common/hostdevice.h"
#include "paddle/phi/kernels/funcs/detail/activation_functions.h"

// TODO(guosheng): refine code style in gru_kernel
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/funcs/detail/lstm_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include <type_traits>

#include "paddle/phi/core/hostdevice.h"
#include "paddle/common/hostdevice.h"
#include "paddle/phi/kernels/funcs/detail/activation_functions.h"

namespace phi {
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/funcs/diag_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

#pragma once

#include "paddle/common/hostdevice.h"
#include "paddle/phi/common/type_traits.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/hostdevice.h"
#include "paddle/phi/kernels/full_kernel.h"
#include "paddle/phi/kernels/funcs/for_range.h"

Expand Down
Loading