From 458365cff867e58f98f46d9682c3ac145469a1ad Mon Sep 17 00:00:00 2001 From: Chen Weihang Date: Wed, 29 Dec 2021 08:03:15 -0600 Subject: [PATCH] unify infermeta target (#38580) --- paddle/pten/CMakeLists.txt | 3 +-- paddle/pten/infermeta/CMakeLists.txt | 4 +--- paddle/pten/kernels/CMakeLists.txt | 1 + paddle/pten/kernels/matmul_kernel.h | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/paddle/pten/CMakeLists.txt b/paddle/pten/CMakeLists.txt index 7adfca4031..97be4c19c9 100644 --- a/paddle/pten/CMakeLists.txt +++ b/paddle/pten/CMakeLists.txt @@ -23,13 +23,12 @@ add_subdirectory(ops) add_subdirectory(tests) # make an unity target for compile deps -set(PTEN_DEPS convert_utils dense_tensor pten_context kernel_factory kernel_context) +set(PTEN_DEPS convert_utils dense_tensor pten_context kernel_factory kernel_context infermeta) get_property(pten_kernels GLOBAL PROPERTY PTEN_KERNELS) # keep this message for debug, remove it later if needless message(STATUS "All standard pten kernels: ${pten_kernels}") set(PTEN_DEPS ${PTEN_DEPS} ${pten_kernels}) set(PTEN_DEPS ${PTEN_DEPS} math_cpu) -set(PTEN_DEPS ${PTEN_DEPS} nary unary binary) if(WITH_GPU OR WITH_ROCM) set(PTEN_DEPS ${PTEN_DEPS} math_gpu) endif() diff --git a/paddle/pten/infermeta/CMakeLists.txt b/paddle/pten/infermeta/CMakeLists.txt index b32ec0a51c..2b4bba8313 100644 --- a/paddle/pten/infermeta/CMakeLists.txt +++ b/paddle/pten/infermeta/CMakeLists.txt @@ -1,3 +1 @@ -cc_library(nary SRCS nary.cc DEPS convert_utils) -cc_library(unary SRCS unary.cc DEPS convert_utils) -cc_library(binary SRCS binary.cc DEPS convert_utils) +cc_library(infermeta SRCS nary.cc unary.cc binary.cc DEPS convert_utils) diff --git a/paddle/pten/kernels/CMakeLists.txt b/paddle/pten/kernels/CMakeLists.txt index be4f0d5b19..7a785d8692 100644 --- a/paddle/pten/kernels/CMakeLists.txt +++ b/paddle/pten/kernels/CMakeLists.txt @@ -26,6 +26,7 @@ set_property(GLOBAL PROPERTY PTEN_KERNELS "") set(COMMON_KERNEL_DEPS dense_tensor kernel_context kernel_factory) set(COMMON_KERNEL_DEPS ${COMMON_KERNEL_DEPS} eigen_function) +set(COMMON_KERNEL_DEPS ${COMMON_KERNEL_DEPS} infermeta) # auto build kernel targets by cmake register_kernels(DEPS ${COMMON_KERNEL_DEPS}) diff --git a/paddle/pten/kernels/matmul_kernel.h b/paddle/pten/kernels/matmul_kernel.h index 5a1766330b..fb54a5301e 100644 --- a/paddle/pten/kernels/matmul_kernel.h +++ b/paddle/pten/kernels/matmul_kernel.h @@ -16,7 +16,7 @@ #include "paddle/pten/api/lib/utils/storage.h" #include "paddle/pten/core/dense_tensor.h" -#include "paddle/pten/include/infermeta.h" +#include "paddle/pten/infermeta/binary.h" namespace pten { -- GitLab