From 9d5b665c5fd01500dbe9a6ccc5601f1fcae75e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=98=8E=E5=86=AC?= <78149749+winter-wang@users.noreply.github.com> Date: Wed, 29 Dec 2021 13:54:22 +0800 Subject: [PATCH] [infrt] fix infrt ci test. test=develop, test=infrt (#38533) --- paddle/infrt/CMakeLists.txt | 5 ++++- paddle/infrt/dialect/tensorrt/trt_ops.h | 2 +- paddle/infrt/paddle/CMakeLists.txt | 6 ------ paddle/infrt/paddle/cpp/CMakeLists.txt | 11 ----------- paddle/infrt/paddle/pb/CMakeLists.txt | 8 -------- paddle/scripts/infrt_build.sh | 5 ++--- 6 files changed, 7 insertions(+), 30 deletions(-) diff --git a/paddle/infrt/CMakeLists.txt b/paddle/infrt/CMakeLists.txt index c81a0fe91cf..3bcc9f59b2e 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 176db988426..c9043c2280d 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 172d78ecde3..21c117535fe 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 0feaabd2fa7..8b48603bddf 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 fac38afa62d..b3491cfe136 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 e31c19b4dea..cc948e7a8da 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 -- GitLab