# file(GLOB TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_*.py")
# string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")

if(WITH_DISTRIBUTE)

  # NOTE(zyl): unittests WITH single card and WITHOUT timeout
  py_test_modules(test_matmul_rule MODULES test_matmul_rule)
  py_test_modules(test_embedding_rule MODULES test_embedding_rule)
  py_test_modules(test_replicated_rule MODULES test_replicated_rule)
  py_test_modules(test_softmax_rule MODULES test_softmax_rule)
  py_test_modules(test_split_rule MODULES test_split_rule)
  py_test_modules(test_transpose_rule MODULES test_transpose_rule)
  py_test_modules(test_elementwise_rule MODULES test_elementwise_rule)
  py_test_modules(test_cross_entropy_with_softmax_rule MODULES
                  test_cross_entropy_with_softmax_rule)
  py_test_modules(test_reduction_rule MODULES test_reduction_rule)
  py_test_modules(test_reshape_rule MODULES test_reshape_rule)
  py_test_modules(test_default_data_parallel_rule MODULES
                  test_default_data_parallel_rule)
  py_test_modules(test_layer_norm_rule MODULES test_layer_norm_rule)
  py_test_modules(test_squeeze_rule MODULES test_squeeze_rule)
  py_test_modules(test_slice_rule MODULES test_slice_rule)
  py_test_modules(test_flatten_rule MODULES test_flatten_rule)
  py_test_modules(test_unsqueeze_rule MODULES test_unsqueeze_rule)
  py_test_modules(test_concat_rule MODULES test_concat_rule)
  py_test_modules(test_where_rule MODULES test_where_rule)
  py_test_modules(test_triu_rule MODULES test_triu_rule)
  py_test_modules(test_flash_attention_rule MODULES test_flash_attention_rule)
  py_test_modules(test_tile_rule MODULES test_tile_rule)
  py_test_modules(test_one_hot_rule MODULES test_one_hot_rule)
  py_test_modules(test_fused_linear_param_grad_add_rule MODULES
                  test_fused_linear_param_grad_add_rule)
  py_test_modules(test_scatter_rule MODULES test_scatter_rule)
  py_test_modules(test_scatter_nd_add_rule MODULES test_scatter_nd_add_rule)
  py_test_modules(test_gather_rule MODULES test_gather_rule)
  py_test_modules(test_cumsum_rule MODULES test_cumsum_rule)
  py_test_modules(test_argmax_rule MODULES test_argmax_rule)
  py_test_modules(test_unbind_rule MODULES test_unbind_rule)
  py_test_modules(test_stack_rule MODULES test_stack_rule)
  py_test_modules(test_gather_nd_rule MODULES test_gather_nd_rule)
  py_test_modules(test_pad_rule MODULES test_pad_rule)
  py_test_modules(test_fused_dropout_add_rule MODULES
                  test_fused_dropout_add_rule)
  py_test_modules(test_logsumexp_rule MODULES test_logsumexp_rule)
  py_test_modules(test_nonzero_rule MODULES test_nonzero_rule)
  if(NOT WITH_ROCM)
    py_test_modules(test_expand_as_rule MODULES test_expand_as_rule)
    py_test_modules(test_roll_rule MODULES test_roll_rule)
    py_test_modules(test_unique_rule MODULES test_unique_rule)
    py_test_modules(test_topk_rule MODULES test_topk_rule)
    py_test_modules(test_add_n_rule MODULES test_add_n_rule)
    py_test_modules(test_roi_align_rule MODULES test_roi_align_rule)
    py_test_modules(test_mean_all_rule MODULES test_mean_all_rule)
    py_test_modules(test_argmin_rule MODULES test_argmin_rule)
    py_test_modules(test_cummax_rule MODULES test_cummax_rule)
    py_test_modules(test_cummin_rule MODULES test_cummin_rule)
    py_test_modules(test_argsort_rule MODULES test_argsort_rule)
    py_test_modules(test_label_smooth_rule MODULES test_label_smooth_rule)
    py_test_modules(test_index_select_rule MODULES test_index_select_rule)
    py_test_modules(test_put_along_axis_rule MODULES test_put_along_axis_rule)
    py_test_modules(test_fused_gemm_epilogue_rule MODULES
                    test_fused_gemm_epilogue_rule)
    py_test_modules(test_gelu_rule MODULES test_gelu_rule)
    py_test_modules(test_take_along_axis_rule MODULES test_take_along_axis_rule)
    py_test_modules(test_conv3d_rule MODULES test_conv3d_rule)
    py_test_modules(test_depthwise_conv2d_rule MODULES
                    test_depthwise_conv2d_rule)
    py_test_modules(test_conv2d_transpose_rule MODULES
                    test_conv2d_transpose_rule)
    py_test_modules(test_einsum_rule MODULES test_einsum_rule)
  endif()
  # End of unittests WITH single card WITHOUT timeout

endif()
