CMakeLists.txt 2.9 KB
Newer Older
1 2
# New custom OP can support Windows/Linux/Mac now
if(WITH_GPU OR APPLE)
3 4 5 6
  py_test(test_custom_relu_op_setup SRCS test_custom_relu_op_setup.py)
  py_test(test_custom_relu_op_jit SRCS test_custom_relu_op_jit.py)
  py_test(test_custom_relu_model SRCS test_custom_relu_model.py)
  py_test(test_context_pool SRCS test_context_pool.py)
7

8 9 10 11 12 13 14 15 16 17 18 19
  # Compiling shared library will cost some time, but running process is very fast.
  set_tests_properties(test_custom_relu_op_setup PROPERTIES TIMEOUT 250)
  set_tests_properties(test_custom_relu_op_jit PROPERTIES TIMEOUT 180)
  set_tests_properties(test_custom_relu_model PROPERTIES TIMEOUT 180)
  set_tests_properties(test_context_pool PROPERTIES TIMEOUT 180)
  if($ENV{USE_STANDALONE_EXECUTOR})
    # these test will fail in some server due to PR#42149, temporarily set it use old executor.
    set_tests_properties(test_custom_relu_op_setup
                         PROPERTIES ENVIRONMENT FLAGS_USE_STANDALONE_EXECUTOR=0)
    set_tests_properties(test_custom_relu_model
                         PROPERTIES ENVIRONMENT FLAGS_USE_STANDALONE_EXECUTOR=0)
  endif()
20
endif()
21

22 23 24 25 26 27 28
if(WITH_GPU AND WITH_DISTRIBUTE)
  py_test(test_custom_op_relu_model_static_multidevice
          SRCS test_custom_op_relu_model_static_multidevice.py)
  set_tests_properties(test_custom_op_relu_model_static_multidevice
                       PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 180)
endif()
if(WITH_XPU AND WITH_DISTRIBUTE)
29 30 31
  set(CUSTOM_XPU_ENVS FLAGS_init_allocated_mem=0)
  py_test(test_custom_relu_op_xpu_setup SRCS test_custom_relu_op_xpu_setup.py
                                             ENVS ${CUSTOM_XPU_ENVS})
32 33 34 35 36
  py_test(test_custom_op_relu_model_static_multidevice
          SRCS test_custom_op_relu_model_static_multidevice.py ENVS
               ${CUSTOM_XPU_ENVS})
  set_tests_properties(test_custom_op_relu_model_static_multidevice
                       PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE" TIMEOUT 180)
37 38
endif()

39 40
py_test(test_custom_raw_op_kernel_op SRCS test_custom_raw_op_kernel_op.py)
set_tests_properties(test_custom_raw_op_kernel_op PROPERTIES TIMEOUT 180)
41 42
py_test(test_custom_tensor_operator SRCS test_custom_tensor_operator.py)
set_tests_properties(test_custom_tensor_operator PROPERTIES TIMEOUT 180)
43

44
# CPU custom op tests: only compile .cc file
45 46
py_test(test_dispatch_jit SRCS test_dispatch_jit.py)
py_test(test_multi_out_jit SRCS test_multi_out_jit.py)
47
py_test(test_custom_attrs_jit SRCS test_custom_attrs_jit.py)
48
py_test(test_custom_concat SRCS test_custom_concat.py)
49
py_test(test_custom_conj SRCS test_custom_conj.py)
50
py_test(test_custom_linear SRCS test_custom_linear.py)
51
py_test(test_custom_simple_slice SRCS test_custom_simple_slice.py)
52
py_test(test_custom_tanh_double_grad SRCS test_custom_tanh_double_grad.py)
53
py_test(test_custom_inplace SRCS test_custom_inplace.py)
54

55
# other tests
56
py_test(test_sysconfig SRCS test_sysconfig.py)
57
py_test(test_check_abi SRCS test_check_abi.py)
J
Jiabin Yang 已提交
58 59

if(APPLE)
60
  set_tests_properties(test_custom_simple_slice PROPERTIES TIMEOUT 300)
J
Jiabin Yang 已提交
61
endif()