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
11d00d61
Commit
11d00d61
authored
Oct 18, 2018
by
Paul
Browse files
Formatting
parent
3d1ae7d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
src/targets/gpu/include/migraph/gpu/hip.hpp
src/targets/gpu/include/migraph/gpu/hip.hpp
+3
-3
src/targets/gpu/write_literals.cpp
src/targets/gpu/write_literals.cpp
+4
-4
test/gpu/literal.cpp
test/gpu/literal.cpp
+7
-4
No files found.
src/targets/gpu/include/migraph/gpu/hip.hpp
View file @
11d00d61
...
...
@@ -70,10 +70,10 @@ struct hip_write
struct
hip_copy
{
std
::
string
name
()
const
{
return
"hip_copy"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
}.
has
(
2
);
return
inputs
.
at
(
1
);
return
inputs
.
at
(
1
);
}
argument
compute
(
context
&
,
const
shape
&
,
std
::
vector
<
argument
>
args
)
const
{
...
...
src/targets/gpu/write_literals.cpp
View file @
11d00d61
...
...
@@ -35,12 +35,12 @@ void write_literals::apply(program& p) const
{
if
(
enabled
(
MIGRAPH_COPY_LITERALS
{}))
{
literal
l
=
ins
->
get_literal
();
auto
pre
=
p
.
add_literal
(
l
);
auto
s
=
p
.
add_outline
(
l
.
get_shape
());
literal
l
=
ins
->
get_literal
();
auto
pre
=
p
.
add_literal
(
l
);
auto
s
=
p
.
add_outline
(
l
.
get_shape
());
auto
alloc
=
p
.
insert_instruction
(
std
::
next
(
pre
),
hip_allocate
{},
s
);
p
.
replace_instruction
(
ins
,
hip_copy
{},
pre
,
alloc
);
}
}
else
{
argument
a
=
to_gpu
(
ins
->
get_literal
().
get_argument
());
...
...
test/gpu/literal.cpp
View file @
11d00d61
...
...
@@ -13,10 +13,13 @@ void gpu_literal_test()
p
.
add_literal
(
lit
);
p
.
compile
(
migraph
::
gpu
::
target
{});
auto
scratch
=
p
.
get_parameter
(
"scratch"
);
if
(
scratch
==
p
.
end
())
{
auto
result
=
p
.
eval
({});
EXPECT
(
lit
==
migraph
::
gpu
::
from_gpu
(
result
));
}
else
{
if
(
scratch
==
p
.
end
())
{
auto
result
=
p
.
eval
({});
EXPECT
(
lit
==
migraph
::
gpu
::
from_gpu
(
result
));
}
else
{
EXPECT
(
scratch
->
get_shape
().
bytes
()
==
lit
.
get_shape
().
bytes
());
}
}
...
...
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