From 371ac33ff477c031062a779a4e527526df940a17 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 18 Apr 2024 09:23:31 -0700 Subject: [PATCH] Add strict type --- test/op_shape_test.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/op_shape_test.cpp b/test/op_shape_test.cpp index 1f961115d0c..333a7f9ef63 100644 --- a/test/op_shape_test.cpp +++ b/test/op_shape_test.cpp @@ -2466,6 +2466,20 @@ TEST_CASE(pointwise_no_output) EXPECT(test::throws([&] { mm->add_instruction(migraphx::make_op("pointwise"), args, {&m}); })); } +TEST_CASE(pointwise_strict_type) +{ + migraphx::shape s{migraphx::shape::float_type, {2, 3}}; + migraphx::program p; + auto* mm = p.get_main_module(); + migraphx::module pm; + { + auto x = pm.add_parameter("x", s.with_type(migraphx::shape::half_type)); + pm.add_return({x}); + } + auto x = mm->add_parameter("x", s); + EXPECT(test::throws([&] { mm->add_instruction(migraphx::make_op("pointwise"), {x}, {&pm}); })); +} + TEST_CASE(pooling_shape0) { migraphx::shape input{migraphx::shape::float_type, {4, 3, 3, 3}};