Commit 9254df13 authored by Umang Yadav's avatar Umang Yadav
Browse files

add verify tests for abs, acos, add

parent 490ad9ba
...@@ -27,14 +27,20 @@ ...@@ -27,14 +27,20 @@
#include <migraphx/generate.hpp> #include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp> #include <migraphx/make_op.hpp>
struct test_abs : verify_program<test_abs> template <migraphx::shape::type_t DType>
struct test_abs : verify_program<test_abs<DType>>
{ {
migraphx::program create_program() const migraphx::program create_program() const
{ {
migraphx::program p; migraphx::program p;
auto* mm = p.get_main_module(); auto* mm = p.get_main_module();
auto x = mm->add_parameter("x", migraphx::shape{migraphx::shape::float_type, {4, 3, 3, 3}}); auto x = mm->add_parameter("x", migraphx::shape{DType, {4, 3, 3, 3}});
mm->add_instruction(migraphx::make_op("abs"), x); mm->add_instruction(migraphx::make_op("abs"), x);
return p; return p;
} }
}; };
template struct test_abs<migraphx::shape::float8_type>;
template struct test_abs<migraphx::shape::half_type>;
template struct test_abs<migraphx::shape::float_type>;
...@@ -27,15 +27,21 @@ ...@@ -27,15 +27,21 @@
#include <migraphx/generate.hpp> #include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp> #include <migraphx/make_op.hpp>
struct test_acos : verify_program<test_acos> template<migraphx::shape::type_t DType>
struct test_acos : verify_program<test_acos<DType>>
{ {
migraphx::program create_program() const migraphx::program create_program() const
{ {
migraphx::program p; migraphx::program p;
auto* mm = p.get_main_module(); auto* mm = p.get_main_module();
migraphx::shape s{migraphx::shape::float_type, {16}}; migraphx::shape s{DType, {16}};
auto x = mm->add_parameter("x", s); auto x = mm->add_parameter("x", s);
mm->add_instruction(migraphx::make_op("acos"), x); mm->add_instruction(migraphx::make_op("acos"), x);
return p; return p;
} }
}; };
template struct test_acos<migraphx::shape::float8_type>;
template struct test_acos<migraphx::shape::half_type>;
template struct test_acos<migraphx::shape::float_type>;
...@@ -27,16 +27,21 @@ ...@@ -27,16 +27,21 @@
#include <migraphx/generate.hpp> #include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp> #include <migraphx/make_op.hpp>
struct test_add : verify_program<test_add> template <migraphx::shape::type_t DType>
struct test_add : verify_program<test_add<DType>>
{ {
migraphx::program create_program() const migraphx::program create_program() const
{ {
migraphx::program p; migraphx::program p;
auto* mm = p.get_main_module(); auto* mm = p.get_main_module();
migraphx::shape s{migraphx::shape::float_type, {3}}; migraphx::shape s{DType, {8}};
auto x = mm->add_parameter("x", s); auto x = mm->add_parameter("x", s);
auto y = mm->add_parameter("y", s); auto y = mm->add_parameter("y", s);
mm->add_instruction(migraphx::make_op("add"), x, y); mm->add_instruction(migraphx::make_op("add"), x, y);
return p; return p;
} }
}; };
template struct test_add<migraphx::shape::float8_type>;
template struct test_add<migraphx::shape::half_type>;
template struct test_add<migraphx::shape::float_type>;
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