Commit 8d45fc33 authored by Robert Kimball's avatar Robert Kimball Committed by Scott Cyphers

remove unit test for integer division by zero since it is undefined behavior in c++ (#2615)

parent 1e6afbac
# need to check
computation_reuse
# cuda does not support throw
divide_by_zero_int32
# int64 is not supprted by cuDNN
dot_matrix_vector_int64
generate_mask
......
......@@ -2,4 +2,3 @@ computation_reuse
tensorview_custom_mem
batch_norm_inference_f64
batch_norm_inference_f32
divide_by_zero_int32
......@@ -6,7 +6,6 @@ backwards_dot_tensor_vector
backwards_replace_slice
backwards_slice
batch_norm_bprop_n4c3h2w2
divide_by_zero_int32
embedding_lookup_10x1_arbitrary
embedding_lookup_10x1_arbitrary_index_type_int
embedding_lookup_4x5_reverse
......
# Tests not supported by the PlaidML backend
backwards_reverse_sequence_n3_c2_h3 # No plans to implement ReverseSequence
backwards_reverse_sequence_n4d2c3h2w2 # No plans to implement ReverseSequence
divide_by_zero_int32 # PlaidML does not die.
max_matrix_rows_zero # Out-of-range for PlaidML
max_matrix_rows_zero_int32 # Out-of-range for PlaidML
max_matrix_cols_zero # Out-of-range for PlaidML
......
......@@ -264,48 +264,6 @@ NGRAPH_TEST(${BACKEND_NAME}, divide_by_zero_float32)
std::numeric_limits<float>::infinity()}),
read_vector<float>(result));
}
#ifdef NGRAPH_DISTRIBUTED_ENABLE
NGRAPH_TEST(${BACKEND_NAME}, DISABLED_divide_by_zero_int32)
#else
NGRAPH_TEST(${BACKEND_NAME}, divide_by_zero_int32)
#endif
{
Shape shape{2, 2};
auto A = make_shared<op::Parameter>(element::i32, shape);
auto B = make_shared<op::Parameter>(element::i32, shape);
auto f = make_shared<Function>(make_shared<op::Divide>(A, B), ParameterVector{A, B});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
// Create some tensors for input/output
auto a = backend->create_tensor(element::i32, shape);
copy_data(a, vector<int>{2, 4, 8, 16});
auto b = backend->create_tensor(element::i32, shape);
copy_data(b, vector<int>{0, 0, 0, 0});
auto result = backend->create_tensor(element::i32, shape);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wused-but-marked-unused"
#pragma clang diagnostic ignored "-Wcovered-switch-default"
::testing::FLAGS_gtest_death_test_style = "threadsafe";
EXPECT_DEATH_IF_SUPPORTED(
{
try
{
auto handle = backend->compile(f);
handle->call_with_validate({result}, {a, b});
}
catch (...)
{
abort();
}
},
"");
#pragma clang diagnostic pop
}
NGRAPH_TEST(${BACKEND_NAME}, maximum)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment