CMakeLists.txt 1.6 KB
Newer Older
1 2
file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py")
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
Z
zn 已提交
3 4
file(GLOB TEST_DIST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_collective_*.py")
string(REPLACE ".py" "" TEST_DIST_OPS "${TEST_DIST_OPS}")
5 6

if (WITH_MLU)
Z
zn 已提交
7 8 9 10
    foreach(TEST_OP ${TEST_DIST_OPS})
        LIST(REMOVE_ITEM TEST_OPS ${TEST_OP})
    endforeach(TEST_OP)

11 12 13
    foreach(TEST_OP ${TEST_OPS})
        py_test_modules(${TEST_OP} MODULES ${TEST_OP})
    endforeach(TEST_OP)
Z
zn 已提交
14 15

    if(WITH_CNCL)
16
        foreach(TEST_OP ${TEST_DIST_OPS})
Z
zn 已提交
17 18 19
            py_test_modules(${TEST_OP} MODULES ${TEST_OP})
        endforeach(TEST_OP)
        bash_test_modules(test_launch_async_mlu START_BASH test_launch_async_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
20 21 22
        bash_test_modules(test_launch_cloud_mlu START_BASH test_launch_cloud_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
        bash_test_modules(test_launch_nproc_mlu START_BASH test_launch_nproc_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
        bash_test_modules(test_c_comm_init_op_mlu START_BASH test_c_comm_init_op_mlu.sh ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR})
Z
zn 已提交
23
        set_tests_properties(test_collective_broadcast PROPERTIES TIMEOUT 120)
24 25 26 27
        set_tests_properties(test_collective_allreduce PROPERTIES TIMEOUT 120)
        set_tests_properties(test_collective_broadcast_api_mlu PROPERTIES TIMEOUT 120)
        set_tests_properties(test_collective_allreduce_api_mlu PROPERTIES TIMEOUT 120)
        set_tests_properties(test_c_comm_init_op_mlu PROPERTIES TIMEOUT 120)
Z
zn 已提交
28
    endif(WITH_CNCL)
29
endif()