diff --git a/python/paddle/fluid/tests/unittests/ir/inference/CMakeLists.txt b/python/paddle/fluid/tests/unittests/ir/inference/CMakeLists.txt index f59f686e78a32d5099931fdf510babb08a9ce026..58affe1b843fdd436439145c2fa2f6b092204424 100644 --- a/python/paddle/fluid/tests/unittests/ir/inference/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/ir/inference/CMakeLists.txt @@ -47,9 +47,12 @@ if(WITH_MKLDNN) endforeach() endif() -foreach(target ${TEST_INFERENCE_IR_PASSES}) - py_test_modules(${target} MODULES ${target}) -endforeach() +if (WITH_MKLDNN AND TENSORRT_FOUND AND WITH_GPU) + foreach(target ${TEST_INFERENCE_IR_PASSES}) + py_test_modules(${target} MODULES ${target}) + endforeach() +endif() + if(WITH_GPU AND TENSORRT_FOUND) set_tests_properties(test_trt_subgraph_pass PROPERTIES TIMEOUT 120) set_tests_properties(test_trt_activation_pass PROPERTIES TIMEOUT 120) @@ -74,8 +77,8 @@ set_tests_properties(test_trt_nearest_interp_v2_op PROPERTIES TIMEOUT 30) set_tests_properties(test_simplify_with_basic_ops_pass_autoscan PROPERTIES TIMEOUT 60) if (WITH_MKLDNN AND TENSORRT_FOUND AND WITH_GPU) -set_tests_properties(test_emb_eltwise_layernorm_fuse_pass PROPERTIES TIMEOUT 120) -set_tests_properties(test_fc_fuse_pass PROPERTIES TIMEOUT 240) + set_tests_properties(test_emb_eltwise_layernorm_fuse_pass PROPERTIES TIMEOUT 120) + set_tests_properties(test_fc_fuse_pass PROPERTIES TIMEOUT 240) endif() if (WITH_MKLDNN)