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
1b6387fa
"src/targets/gpu/hip.cpp" did not exist on "e85e0fa1ee3a91b4c436ee6eb19199c33fbc1fd0"
Commit
1b6387fa
authored
Feb 04, 2019
by
Paul
Browse files
Add more complete test
parent
06ff76b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
src/py/migraphx_py.cpp
src/py/migraphx_py.cpp
+4
-2
test/py/test.py
test/py/test.py
+8
-0
No files found.
src/py/migraphx_py.cpp
View file @
1b6387fa
...
...
@@ -66,14 +66,16 @@ PYBIND11_MODULE(migraphx, m)
py
::
class_
<
migraphx
::
argument
>
(
m
,
"argument"
,
py
::
buffer_protocol
())
.
def_buffer
([](
migraphx
::
argument
&
x
)
->
py
::
buffer_info
{
return
to_buffer_info
(
x
);
});
py
::
class_
<
migraphx
::
target
>
(
m
,
"target"
);
py
::
class_
<
migraphx
::
program
>
(
m
,
"program"
)
.
def
(
"get_parameter_shapes"
,
&
migraphx
::
program
::
get_parameter_shapes
)
.
def
(
"compile"
,
[](
migraphx
::
program
&
p
,
const
migraphx
::
target
&
t
)
{
p
.
compile
(
t
);
})
.
def
(
"
eval
"
,
&
migraphx
::
program
::
eval
);
.
def
(
"
run
"
,
&
migraphx
::
program
::
eval
);
m
.
def
(
"parse_onnx"
,
&
migraphx
::
parse_onnx
);
m
.
def
(
"target"
,
[](
const
std
::
string
&
name
)
->
migraphx
::
target
{
m
.
def
(
"
get_
target"
,
[](
const
std
::
string
&
name
)
->
migraphx
::
target
{
if
(
name
==
"cpu"
)
return
migraphx
::
cpu
::
target
{};
throw
std
::
runtime_error
(
"Target not found: "
+
name
);
...
...
test/py/test.py
View file @
1b6387fa
import
migraphx
p
=
migraphx
.
parse_onnx
(
"conv_relu_maxpool.onnx"
)
p
.
compile
(
migraphx
.
get_target
(
"cpu"
))
params
=
{}
for
key
,
value
in
p
.
get_parameter_shapes
().
items
():
params
[
key
]
=
migraphx
.
generate_argument
(
value
)
r
=
p
.
run
(
params
)
print
(
r
)
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