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
5f82df2f
"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "fa0dc35f734b59cfe91b85a08799a704fd0020a3"
Commit
5f82df2f
authored
Nov 01, 2018
by
Shucai Xiao
Browse files
add the slice test example on gpu.
parent
f76e2490
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+20
-0
No files found.
test/gpu/miopen.cpp
View file @
5f82df2f
...
...
@@ -216,6 +216,25 @@ struct test_scale
}
};
struct
test_slice
{
migraph
::
program
create_program
()
const
{
migraph
::
program
p
;
migraph
::
shape
s
{
migraph
::
shape
::
int32_type
,
{
2
,
2
,
3
}};
std
::
vector
<
int
>
data
(
2
*
2
*
3
);
std
::
iota
(
data
.
begin
(),
data
.
end
(),
0
);
auto
l
=
p
.
add_literal
(
migraph
::
literal
{
s
,
data
});
auto
slice0
=
p
.
add_instruction
(
migraph
::
op
::
slice
{{
2
},
{
0
},
{
1
}},
l
);
auto
slice1
=
p
.
add_instruction
(
migraph
::
op
::
slice
{{
2
},
{
1
},
{
3
}},
l
);
auto
add0
=
p
.
add_instruction
(
migraph
::
op
::
add
{},
slice0
,
slice0
);
auto
add1
=
p
.
add_instruction
(
migraph
::
op
::
add
{},
slice1
,
slice1
);
p
.
add_instruction
(
migraph
::
op
::
concat
{
2
},
add0
,
add1
);
return
p
;
}
};
struct
test_triadd
{
migraph
::
program
create_program
()
const
...
...
@@ -740,4 +759,5 @@ int main()
verify_program
<
test_conv_bn
>
();
verify_program
<
test_conv_bn_relu_pooling
>
();
verify_program
<
test_conv_bn_relu_pooling2
>
();
verify_program
<
test_slice
>
();
}
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