CMakeLists.txt 3.1 KB
Newer Older
1 2 3 4 5
file(GLOB TEST_INFERENCE_IR_PASSES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py")
string(REPLACE ".py" "" TEST_INFERENCE_IR_PASSES "${TEST_INFERENCE_IR_PASSES}")

file(GLOB TEST_TRT_IR_PASSES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_trt_*.py")
string(REPLACE ".py" "" TEST_TRT_IR_PASSES "${TEST_TRT_IR_PASSES}")
W
Wilber 已提交
6 7 8 9

file(GLOB TEST_TRT_CONVERTER RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_trt_convert_*.py")
string(REPLACE ".py" "" TEST_TRT_CONVERTER "${TEST_TRT_CONVERTER}")

10 11 12 13 14
foreach(TEST_INFERENCE_IR_PASS ${TEST_TRT_IR_PASSES})
  list(REMOVE_ITEM TEST_INFERENCE_IR_PASSES ${TEST_INFERENCE_IR_PASS})
endforeach()

if(WITH_GPU AND TENSORRT_FOUND)
W
Wangzheee 已提交
15
  list(REMOVE_ITEM TEST_TRT_IR_PASSES test_trt_multiclass_nms_op)
W
Wilber 已提交
16 17 18 19 20

  foreach(TRT_CONVERT ${TEST_TRT_CONVERTER})
    list(REMOVE_ITEM TEST_TRT_IR_PASSES ${TRT_CONVERT})
  endforeach()

21
  foreach(target ${TEST_TRT_IR_PASSES})
S
Shang Zhizhou 已提交
22 23 24 25 26 27 28 29
    if(${target} STREQUAL "test_trt_slice_dynamic_plugin")
      if("${TENSORRT_MAJOR_VERSION}.${TENSORRT_MINOR_VERSION}" VERSION_GREATER "7.1")
        py_test_modules(${target} MODULES ${target})
        set_tests_properties(${target} PROPERTIES TIMEOUT 60)
      endif()
    else()
      py_test_modules(${target} MODULES ${target})
    endif()
30
  endforeach()
W
Wilber 已提交
31 32 33

  foreach(target ${TEST_TRT_CONVERTER})
    py_test_modules(${target} MODULES ${target})
34
    set_tests_properties(${target} PROPERTIES TIMEOUT 300)
W
Wilber 已提交
35
  endforeach()
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
endif()

file(GLOB TEST_MKLDNN_IR_PASSES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_mkldnn_*.py")
string(REPLACE ".py" "" TEST_MKLDNN_IR_PASSES "${TEST_MKLDNN_IR_PASSES}")
foreach(TEST_INFERENCE_IR_PASS ${TEST_MKLDNN_IR_PASSES})
  list(REMOVE_ITEM TEST_INFERENCE_IR_PASSES ${TEST_INFERENCE_IR_PASS})
endforeach()

if(WITH_MKLDNN)
  foreach(target ${TEST_MKLDNN_IR_PASSES})
    py_test_modules(${target} MODULES ${target})
  endforeach()
endif()

foreach(target ${TEST_INFERENCE_IR_PASSES})
  py_test_modules(${target} MODULES ${target})
endforeach()
Y
YUNSHEN XIE 已提交
53 54
if(WITH_GPU AND TENSORRT_FOUND)
set_tests_properties(test_trt_subgraph_pass PROPERTIES TIMEOUT 120)
55 56
set_tests_properties(test_trt_activation_pass PROPERTIES TIMEOUT 120)
set_tests_properties(test_trt_conv_pass PROPERTIES TIMEOUT 120)
W
Wangzheee 已提交
57
#set_tests_properties(test_trt_multiclass_nms_op PROPERTIES TIMEOUT 200)
58
set_tests_properties(test_trt_dynamic_shape PROPERTIES TIMEOUT 120)
F
feng_shuai 已提交
59 60 61 62 63
if(WITH_NV_JETSON)
  set_tests_properties(test_trt_pool_op PROPERTIES ENVIRONMENT FLAGS_fraction_of_gpu_memory_to_use=0.1 TIMEOUT 450)
else()
  set_tests_properties(test_trt_pool_op PROPERTIES ENVIRONMENT FLAGS_fraction_of_gpu_memory_to_use=0.1 TIMEOUT 45)
endif()
W
wenbin 已提交
64
set_tests_properties(test_trt_reduce_mean_op PROPERTIES TIMEOUT 60)
W
wenbin 已提交
65
set_tests_properties(test_trt_tile_op PROPERTIES TIMEOUT 60)
66 67 68
set_tests_properties(test_trt_fc_fuse_quant_dequant_pass PROPERTIES TIMEOUT 100)
set_tests_properties(test_trt_conv_quant_dequant_pass PROPERTIES TIMEOUT 100)
set_tests_properties(test_trt_matmul_quant_dequant PROPERTIES TIMEOUT 100)
W
wenbin 已提交
69 70
set_tests_properties(test_trt_conv3d_op PROPERTIES TIMEOUT 60)
set_tests_properties(test_trt_conv3d_transpose_op PROPERTIES TIMEOUT 60)
71
set_tests_properties(test_trt_nearest_interp_v2_op PROPERTIES TIMEOUT 30)
Y
YUNSHEN XIE 已提交
72
endif()