Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
9254df13
Commit
9254df13
authored
Nov 07, 2023
by
Umang Yadav
Browse files
add verify tests for abs, acos, add
parent
490ad9ba
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
6 deletions
+23
-6
test/verify/test_abs.cpp
test/verify/test_abs.cpp
+8
-2
test/verify/test_acos.cpp
test/verify/test_acos.cpp
+8
-2
test/verify/test_add.cpp
test/verify/test_add.cpp
+7
-2
No files found.
test/verify/test_abs.cpp
View file @
9254df13
...
@@ -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_t
ype
,
{
4
,
3
,
3
,
3
}});
auto
x
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
DT
ype
,
{
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
>;
test/verify/test_acos.cpp
View file @
9254df13
...
@@ -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_t
ype
,
{
16
}};
migraphx
::
shape
s
{
DT
ype
,
{
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
>;
test/verify/test_add.cpp
View file @
9254df13
...
@@ -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_t
ype
,
{
3
}};
migraphx
::
shape
s
{
DT
ype
,
{
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
>;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment