diff --git a/paddle/infrt/CMakeLists.txt b/paddle/infrt/CMakeLists.txt index c81a0fe91cf6e99c45c7873af7d63b7af40db4ee..3bcc9f59b2e9c57a2a402c9adbeda26bf4c088a2 100644 --- a/paddle/infrt/CMakeLists.txt +++ b/paddle/infrt/CMakeLists.txt @@ -3,7 +3,7 @@ if (NOT WITH_INFRT) endif() set(INFRT_SOURCE_DIR "${PADDLE_SOURCE_DIR}/paddle/infrt" ) set(INFRT_BINARY_DIR "${PADDLE_BINARY_DIR}/paddle/infrt" ) - +set(INFRT_TEST_TARGETS CACHE INTERNAL "") include(infrt_lib) set(infrt_src CACHE INTERNAL "" FORCE) @@ -46,6 +46,7 @@ function(cc_test_tiny TARGET_NAME) if (${cc_test_tiny_SERIAL}) set_property(TEST ${TARGET_NAME} PROPERTY RUN_SERIAL 1) endif() + set(INFRT_TEST_TARGETS ${INFRT_TEST_TARGETS} ${TARGET_NAME} CACHE INTERNAL "") endif() endfunction() @@ -83,3 +84,5 @@ message(STATUS "infrt srcs:\n${infrt_src}") cc_library(infrt SHARED SRCS ${infrt_src} DEPS glog boost ${mlir_libs} paddle_framework_proto) cc_library(infrt_static SRCS ${infrt_src} DEPS glog boost ${mlir_libs} paddle_framework_proto) add_dependencies(infrt ${infrt_mlir_incs}) + +add_custom_target(test_infrt_exec DEPENDS ${INFRT_TEST_TARGETS}) diff --git a/paddle/infrt/dialect/tensorrt/trt_ops.h b/paddle/infrt/dialect/tensorrt/trt_ops.h index 176db9884262b4d8b292a05b205c6ec1b65c14e4..c9043c2280de0f7970fb323876b10c68c6a63de7 100755 --- a/paddle/infrt/dialect/tensorrt/trt_ops.h +++ b/paddle/infrt/dialect/tensorrt/trt_ops.h @@ -43,7 +43,7 @@ class TensorRTDialect : public ::mlir::Dialect { using namespace mlir; // NOLINT #define GET_OP_CLASSES -#include "dialect/tensorrt/trt_ops.hpp.inc" +#include "paddle/infrt/dialect/tensorrt/trt_ops.hpp.inc" #undef GET_OP_CLASSES } // namespace trt diff --git a/paddle/infrt/paddle/CMakeLists.txt b/paddle/infrt/paddle/CMakeLists.txt index 172d78ecde3b8086e6640f8431a4f20193216788..21c117535fe7058c17c50a471c7b7d91407690df 100644 --- a/paddle/infrt/paddle/CMakeLists.txt +++ b/paddle/infrt/paddle/CMakeLists.txt @@ -11,12 +11,6 @@ gather_srcs(infrt_src SRCS tensor.cc ) -foreach(cpp ${SRCS}) - set(infrt_src - "${infrt_src};infrt/paddle/${cpp}" - CACHE INTERNAL "") -endforeach() - file(GLOB includes LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} *.h) foreach(header ${includes}) diff --git a/paddle/infrt/paddle/cpp/CMakeLists.txt b/paddle/infrt/paddle/cpp/CMakeLists.txt index 0feaabd2fa7c93816d3965d5534fcdda718d4ed5..8b48603bddf8e815f5fe216eda5e7582f6a5a025 100644 --- a/paddle/infrt/paddle/cpp/CMakeLists.txt +++ b/paddle/infrt/paddle/cpp/CMakeLists.txt @@ -1,14 +1,3 @@ -core_gather_headers() - -gather_srcs(infrt_src SRCS - ) - -foreach(cpp ${SRCS}) - set(infrt_src - "${infrt_src};infrt/paddle/cpp/${cpp}" - CACHE INTERNAL "") -endforeach() - file(GLOB includes LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} *.h) foreach(header ${includes}) diff --git a/paddle/infrt/paddle/pb/CMakeLists.txt b/paddle/infrt/paddle/pb/CMakeLists.txt index fac38afa62db282ff1b2f83c162cac8e9ab1cd7a..b3491cfe13618e7f8dddb734368c42cf0b1d151e 100644 --- a/paddle/infrt/paddle/pb/CMakeLists.txt +++ b/paddle/infrt/paddle/pb/CMakeLists.txt @@ -1,5 +1,3 @@ -core_gather_headers() - gather_srcs(infrt_src SRCS var_desc.cc op_desc.cc @@ -7,12 +5,6 @@ gather_srcs(infrt_src SRCS program_desc.cc ) -foreach(cpp ${SRCS}) - set(infrt_src - "${infrt_src};infrt/paddle/pb/${cpp}" - CACHE INTERNAL "") -endforeach() - file(GLOB includes LIST_DIRECTORIES false RELATIVE ${CMAKE_SOURCE_DIR} *.h) foreach(header ${includes}) diff --git a/paddle/scripts/infrt_build.sh b/paddle/scripts/infrt_build.sh index e31c19b4dead3d4778d9d8aa2c8b0c9b4aa7a779..cc948e7a8da7fdb0bbbb415d5de7eb0ed8024835 100644 --- a/paddle/scripts/infrt_build.sh +++ b/paddle/scripts/infrt_build.sh @@ -65,13 +65,12 @@ function infrt_gen_and_build() { mkdir -p ${PADDLE_ROOT}/build cd ${PADDLE_ROOT}/build rm -f infrt_summary.txt - cmake .. -DWITH_MKL=OFF -DWITH_GPU=OFF -DCMAKE_BUILD_TYPE=Release -DWITH_INFRT=ON -DWITH_TESTING==${WITH_TESTING:-ON}; build_error=$? + cmake .. -DWITH_MKL=OFF -DWITH_GPU=OFF -DCMAKE_BUILD_TYPE=Release -DWITH_INFRT=ON -DWITH_PYTHON=OFF -DWITH_TESTING==${WITH_TESTING:-ON}; build_error=$? if [ "$build_error" != 0 ];then exit 7; fi - make -j ${parallel_number} infrt infrtopt infrt-exec;build_error=$? - make -j ${parallel_number} infrt_lib_dist;build_error=$? + make -j ${parallel_number} infrt infrtopt infrt-exec test_infrt_exec infrt_lib_dist;build_error=$? if [ "$build_error" != 0 ];then exit 7; fi