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
966d45df
"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "0b7672d7dc246f708f46102ddbaa2d7afb2b54f9"
Commit
966d45df
authored
Oct 26, 2018
by
Paul
Browse files
Add copy syncs
parent
3018c722
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/targets/gpu/hip.cpp
src/targets/gpu/hip.cpp
+2
-0
No files found.
src/targets/gpu/hip.cpp
View file @
966d45df
...
...
@@ -49,10 +49,12 @@ hip_ptr write_to_gpu(const T& x)
template
<
class
T
>
std
::
vector
<
T
>
read_from_gpu
(
const
void
*
x
,
std
::
size_t
sz
)
{
gpu_sync
();
std
::
vector
<
T
>
result
(
sz
);
auto
status
=
hipMemcpy
(
result
.
data
(),
x
,
sz
*
sizeof
(
T
),
hipMemcpyDeviceToHost
);
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Copy from gpu failed: "
+
hip_error
(
status
));
// NOLINT
gpu_sync
();
return
result
;
}
...
...
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