未验证 提交 1911b6f0 编写于 作者: C Chen Weihang 提交者: GitHub

adjust main dir (#37916)

上级 e3f68f42
......@@ -31,8 +31,8 @@ limitations under the License. */
// only can include the headers in paddle/pten/include dirs
#include "paddle/pten/api/lib/utils/tensor_utils.h"
#include "paddle/pten/kernels/functions/cpu/elementwise.h"
#include "paddle/pten/kernels/functions/general/elementwise_base.h"
#include "paddle/pten/kernels/hybird/cpu/elementwise.h"
#include "paddle/pten/kernels/hybird/general/elementwise_base.h"
#if defined(__NVCC__) || defined(__HIPCC__)
#ifdef __NVCC__
......
......@@ -23,7 +23,7 @@ limitations under the License. */
// only can include the headers in paddle/top/api dirs
#include "paddle/pten/api/lib/utils/tensor_utils.h"
#include "paddle/pten/include/core.h"
#include "paddle/pten/kernels/functions/cuda/elementwise/elementwise.h"
#include "paddle/pten/kernels/hybird/cuda/elementwise/elementwise.h"
#ifdef __HIPCC__
#define ELEMENTWISE_BLOCK_SIZE 256
......
......@@ -29,7 +29,7 @@ limitations under the License. */
#include "paddle/fluid/operators/math/math_function_impl.h"
#include "paddle/fluid/platform/bfloat16.h"
#include "paddle/fluid/platform/float16.h"
#include "paddle/pten/kernels/functions/eigen/common.h"
#include "paddle/pten/kernels/hybird/eigen/common.h"
#include "unsupported/Eigen/CXX11/Tensor"
namespace paddle {
......
......@@ -21,7 +21,7 @@ limitations under the License. */
#include "paddle/fluid/operators/math/math_function_impl.h"
#include "paddle/fluid/platform/bfloat16.h"
#include "paddle/fluid/platform/float16.h"
#include "paddle/pten/kernels/functions/eigen/common.h"
#include "paddle/pten/kernels/hybird/eigen/common.h"
namespace paddle {
namespace operators {
......
......@@ -28,7 +28,7 @@ limitations under the License. */
#include "paddle/pten/api/lib/utils/tensor_utils.h"
#include "paddle/pten/include/core.h"
#include "paddle/pten/include/math.h"
#include "paddle/pten/kernels/functions/general/reduce_impl.h"
#include "paddle/pten/kernels/hybird/general/reduce_impl.h"
#if defined(__HIPCC__) || defined(__NVCC__)
#include "paddle/fluid/operators/reduce_ops/reduce_op.cu.h"
......
......@@ -11,10 +11,14 @@ add_subdirectory(common)
add_subdirectory(api)
# pten core components
add_subdirectory(core)
# pten components of specific backends
add_subdirectory(backends)
# pten kernels for diff device
add_subdirectory(kernels)
# pten infermeta
add_subdirectory(infermeta)
# pten operator definitions
add_subdirectory(ops)
# pten tests
add_subdirectory(tests)
......
......@@ -14,7 +14,7 @@ limitations under the License. */
// See Note [ Why still include the fluid headers? ]
#include "paddle/pten/infermeta/binary.h"
#include "paddle/pten/kernels/functions/general/elementwise_base.h"
#include "paddle/pten/kernels/hybird/general/elementwise_base.h"
namespace pten {
......
# pten math functions called by kernels
add_subdirectory(math)
# pten basic functions called by kernels
add_subdirectory(functions)
# pten kernels for diff device
# kernel primitive api
add_subdirectory(primitive)
# pten hybird functors and functions called by kernels
add_subdirectory(hybird)
# pten kernels for different backends
# NOTE(chenweihang): We need to increase the compilation option of WITH_EIGEN,
# which will support splitting eigen at compile time on demand in the future
add_subdirectory(eigen)
# NOTE(chenweihang): We need to increase the compilation option of WITH_BLAS,
# which will support splitting eigen at compile time on demand in the future,
# and if necessary, blas can be split into openblas and cublas
add_subdirectory(blas)
add_subdirectory(cpu)
if(WITH_GPU OR WITH_ROCM)
# TODO(chenweihang): if hip can split from cuda impl, we should add hip dir
# NOTE(chenweihang): if hip can split from cuda impl, we should add hip dir
add_subdirectory(cuda)
endif()
# TODO(chenweihang): migrate MKLDNN Kernel in the second phase of the project
if(WITH_MKLDNN)
add_subdirectory(mkldnn)
# mkldnn will be deprecated and use the new name dnnl
add_subdirectory(dnnl)
endif()
# TODO(chenweihang): migrate NPU Kernel in the second phase of the project
if(WITH_ASCEND_CL)
add_subdirectory(npu)
endif()
# TODO(chenweihang): migrate XPU Kernel in the second phase of the project
if(WITH_XPU)
add_subdirectory(xpu)
endif()
......@@ -15,7 +15,7 @@
#include "paddle/pten/kernels/cpu/creation.h"
#include "paddle/pten/core/kernel_registry.h"
#include "paddle/pten/kernels/functions/eigen/fill.h"
#include "paddle/pten/kernels/hybird/eigen/fill.h"
namespace pten {
......
......@@ -21,7 +21,7 @@
#include "paddle/fluid/operators/math/blas.h"
#include "paddle/fluid/platform/complex.h"
#include "paddle/pten/kernels/functions/math/matmul_func.h"
#include "paddle/pten/kernels/hybird/math/matmul_func.h"
namespace pten {
......
......@@ -16,8 +16,8 @@
#include "paddle/pten/api/ext/dispatch.h"
#include "paddle/pten/infermeta/unary.h"
#include "paddle/pten/kernels/cpu/utils.h"
#include "paddle/pten/kernels/functions/general/manipulation.h"
#include "paddle/pten/kernels/functions/math/cast_func.h"
#include "paddle/pten/kernels/hybird/general/manipulation.h"
#include "paddle/pten/kernels/hybird/math/cast_func.h"
namespace pten {
......
......@@ -15,12 +15,12 @@
#include "paddle/pten/kernels/cpu/math.h"
#include "paddle/pten/api/ext/dispatch.h"
#include "paddle/pten/kernels/functions/cpu/elementwise.h"
#include "paddle/pten/kernels/functions/eigen/reduce.h"
#include "paddle/pten/kernels/functions/eigen/scale.h"
#include "paddle/pten/kernels/functions/eigen/sign.h"
#include "paddle/pten/kernels/functions/general/elementwise_functor.h"
#include "paddle/pten/kernels/functions/general/reduce_impl.h"
#include "paddle/pten/kernels/hybird/cpu/elementwise.h"
#include "paddle/pten/kernels/hybird/eigen/reduce.h"
#include "paddle/pten/kernels/hybird/eigen/scale.h"
#include "paddle/pten/kernels/hybird/eigen/sign.h"
#include "paddle/pten/kernels/hybird/general/elementwise_functor.h"
#include "paddle/pten/kernels/hybird/general/reduce_impl.h"
// See Note [ Why still include the fluid headers? ]
#include "paddle/fluid/framework/eigen.h"
......
......@@ -15,7 +15,7 @@
#include "paddle/pten/kernels/cuda/creation.h"
#include "paddle/pten/core/kernel_registry.h"
#include "paddle/pten/kernels/functions/eigen/fill.h"
#include "paddle/pten/kernels/hybird/eigen/fill.h"
namespace pten {
......
......@@ -15,8 +15,8 @@
#include "paddle/pten/kernels/cuda/linalg.h"
#include "paddle/pten/core/kernel_registry.h"
#include "paddle/pten/kernels/functions/eigen/dot.h"
#include "paddle/pten/kernels/functions/math/matmul_func.h"
#include "paddle/pten/kernels/hybird/eigen/dot.h"
#include "paddle/pten/kernels/hybird/math/matmul_func.h"
// See Note [ Why still include the fluid headers? ]
#include "paddle/fluid/platform/complex.h"
......
......@@ -16,8 +16,8 @@
#include "paddle/pten/infermeta/unary.h"
#include "paddle/pten/kernels/cuda/manipulation.h"
#include "paddle/pten/kernels/cuda/utils.h"
#include "paddle/pten/kernels/functions/cuda/cast_kernel_impl.h"
#include "paddle/pten/kernels/functions/general/manipulation.h"
#include "paddle/pten/kernels/hybird/cuda/cast_kernel_impl.h"
#include "paddle/pten/kernels/hybird/general/manipulation.h"
namespace pten {
......
......@@ -15,12 +15,12 @@ limitations under the License. */
#include "paddle/pten/kernels/cuda/math.h"
#include "paddle/fluid/operators/reduce_ops/reduce_functor_op.h"
#include "paddle/pten/kernels/functions/cuda/elementwise/elementwise.h"
#include "paddle/pten/kernels/functions/cuda/reduce/reduce.h"
#include "paddle/pten/kernels/functions/eigen/scale.h"
#include "paddle/pten/kernels/functions/eigen/sign.h"
#include "paddle/pten/kernels/functions/general/elementwise_functor.h"
#include "paddle/pten/kernels/functions/general/reduce_impl.h"
#include "paddle/pten/kernels/hybird/cuda/elementwise/elementwise.h"
#include "paddle/pten/kernels/hybird/cuda/reduce/reduce.h"
#include "paddle/pten/kernels/hybird/eigen/scale.h"
#include "paddle/pten/kernels/hybird/eigen/sign.h"
#include "paddle/pten/kernels/hybird/general/elementwise_functor.h"
#include "paddle/pten/kernels/hybird/general/reduce_impl.h"
#ifdef __NVCC__
#include "cub/cub.cuh"
......
add_subdirectory(eigen)
add_subdirectory(blas)
add_subdirectory(general)
add_subdirectory(eigen)
add_subdirectory(blas)
add_subdirectory(general)
cc_library(pten_transpose_cpu SRCS transpose.cc DEPS dense_tensor device_context)
if(WITH_GPU)
nv_library(pten_transpose_cuda SRCS transpose.cu DEPS dense_tensor malloc device_context)
elseif(WITH_ROCM)
......
......@@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/general/elementwise_base.h"
#include "paddle/pten/kernels/hybird/general/elementwise_base.h"
namespace pten {
......
......@@ -14,8 +14,8 @@ limitations under the License. */
#pragma once
#include "paddle/pten/kernels/functions/cuda/elementwise/elementwise_broadcast.cu.h"
#include "paddle/pten/kernels/functions/cuda/elementwise/elementwise_no_broadcast.cu.h"
#include "paddle/pten/kernels/hybird/cuda/elementwise/elementwise_broadcast.cu.h"
#include "paddle/pten/kernels/hybird/cuda/elementwise/elementwise_no_broadcast.cu.h"
namespace pten {
......
......@@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/cuda/elementwise/elementwise_common.cu.h"
#include "paddle/pten/kernels/hybird/cuda/elementwise/elementwise_common.cu.h"
namespace pten {
......
......@@ -18,7 +18,7 @@ limitations under the License. */
#include "paddle/fluid/platform/aligned_vector.h"
#include "paddle/fluid/platform/function_traits.h"
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/general/elementwise_base.h"
#include "paddle/pten/kernels/hybird/general/elementwise_base.h"
namespace pten {
namespace kps = paddle::operators::kernel_primitives;
......
......@@ -14,7 +14,7 @@ limitations under the License. */
#pragma once
#include "paddle/pten/kernels/functions/cuda/elementwise/elementwise_common.cu.h"
#include "paddle/pten/kernels/hybird/cuda/elementwise/elementwise_common.cu.h"
#ifdef __HIPCC__
#define ELEMENTWISE_BLOCK_SIZE 256
......
......@@ -21,7 +21,7 @@
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/fluid/platform/device_context.h"
#include "paddle/pten/kernels/functions/cuda/reduce/reduce_cuda_impl.h"
#include "paddle/pten/kernels/hybird/cuda/reduce/reduce_cuda_impl.h"
namespace pten {
......
......@@ -43,7 +43,7 @@ namespace cub = hipcub;
#include "paddle/pten/api/ext/dispatch.h"
#include "paddle/pten/api/include/tensor.h"
#include "paddle/pten/kernels/cuda/utils.h"
#include "paddle/pten/kernels/functions/math/cast_func.h"
#include "paddle/pten/kernels/hybird/math/cast_func.h"
// Reduce split or not, Whether to use ReduceHigherDim
#define REDUCE_SPLIT_BOUNDARY 512
......
......@@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/eigen/common.h"
#include "paddle/pten/kernels/hybird/eigen/common.h"
// See Note [ Why still include the fluid headers? ]
#include "paddle/fluid/operators/eigen/eigen_function.h"
......
......@@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/eigen/common.h"
#include "paddle/pten/kernels/hybird/eigen/common.h"
namespace pten {
namespace eigen {
......
......@@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/eigen/common.h"
#include "paddle/pten/kernels/hybird/eigen/common.h"
// See Note [ Why still include the fluid headers? ]
#include "paddle/fluid/operators/eigen/eigen_function.h"
......
......@@ -16,8 +16,8 @@
#include "paddle/pten/api/lib/utils/allocator.h"
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/eigen/common.h"
#include "paddle/pten/kernels/math/transpose.h"
#include "paddle/pten/kernels/hybird/eigen/common.h"
#include "paddle/pten/kernels/hybird/transpose.h"
// See Note [ Why still include the fluid headers? ]
#include "paddle/fluid/operators/eigen/eigen_function.h"
......
......@@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/eigen/common.h"
#include "paddle/pten/kernels/hybird/eigen/common.h"
// See Note [ Why still include the fluid headers? ]
#include "paddle/fluid/operators/eigen/eigen_function.h"
......
......@@ -15,7 +15,7 @@ limitations under the License. */
#pragma once
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/eigen/common.h"
#include "paddle/pten/kernels/hybird/eigen/common.h"
// See Note [ Why still include the fluid headers? ]
#include "paddle/fluid/operators/eigen/eigen_function.h"
......
......@@ -18,8 +18,8 @@ limitations under the License. */
#include "paddle/fluid/platform/float16.h"
#include "paddle/fluid/platform/hostdevice.h"
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/blas/elementwise.h"
#include "paddle/pten/kernels/functions/eigen/elementwise.h"
#include "paddle/pten/kernels/hybird/blas/elementwise.h"
#include "paddle/pten/kernels/hybird/eigen/elementwise.h"
namespace pten {
namespace general {
......
......@@ -16,8 +16,8 @@
#include "paddle/fluid/platform/transform.h"
#include "paddle/pten/api/ext/dispatch.h"
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/eigen/reduce.h"
#include "paddle/pten/kernels/functions/math/cast_func.h"
#include "paddle/pten/kernels/hybird/eigen/reduce.h"
#include "paddle/pten/kernels/hybird/math/cast_func.h"
namespace pten {
namespace general {
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/pten/kernels/math/transpose.h"
#include "paddle/pten/kernels/hybird/transpose.h"
#include "paddle/fluid/framework/ddim.h"
#include "paddle/pten/core/dense_tensor.h"
......
......@@ -15,8 +15,8 @@
#include "paddle/fluid/framework/ddim.h"
#include "paddle/fluid/memory/memcpy.h"
#include "paddle/pten/core/dense_tensor.h"
#include "paddle/pten/kernels/functions/math/cast_func.h"
#include "paddle/pten/kernels/math/transpose.h"
#include "paddle/pten/kernels/hybird/math/cast_func.h"
#include "paddle/pten/kernels/hybird/transpose.h"
// See Note [ Why still include the fluid headers? ]
#include "paddle/fluid/platform/bfloat16.h"
......
add_subdirectory(cpu)
if(WITH_GPU OR WITH_ROCM)
add_subdirectory(cuda)
endif()
cc_library(pten_transpose_cpu SRCS transpose.cc DEPS dense_tensor device_context)
......@@ -14,7 +14,7 @@
#include "paddle/pten/kernels/xpu/manipulation.h"
#include "paddle/pten/infermeta/unary.h"
#include "paddle/pten/kernels/functions/general/manipulation.h"
#include "paddle/pten/kernels/hybird/general/manipulation.h"
#include "paddle/pten/kernels/xpu/utils.h"
namespace pten {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册