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
01bd7aff
"...resnet50_tensorflow.git" did not exist on "ef30de935798dcd293c2156047d563b99c7dfa69"
Commit
01bd7aff
authored
Oct 28, 2018
by
Paul
Browse files
Remove syncs
parent
00106f54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
6 deletions
+0
-6
src/targets/gpu/hip.cpp
src/targets/gpu/hip.cpp
+0
-6
No files found.
src/targets/gpu/hip.cpp
View file @
01bd7aff
...
...
@@ -27,7 +27,6 @@ hip_ptr allocate_gpu(std::size_t sz, bool host = false)
if
(
sz
>
get_available_gpu_memory
())
MIGRAPH_THROW
(
"Memory not available to allocate buffer: "
+
std
::
to_string
(
sz
));
void
*
result
;
// gpu_sync();
auto
status
=
host
?
hipHostMalloc
(
&
result
,
sz
)
:
hipMalloc
(
&
result
,
sz
);
if
(
status
!=
hipSuccess
)
{
...
...
@@ -36,7 +35,6 @@ hip_ptr allocate_gpu(std::size_t sz, bool host = false)
else
allocate_gpu
(
sz
,
true
);
}
// gpu_sync();
return
hip_ptr
{
result
};
}
...
...
@@ -44,22 +42,18 @@ template <class T>
std
::
vector
<
T
>
read_from_gpu
(
const
void
*
x
,
std
::
size_t
sz
)
{
std
::
vector
<
T
>
result
(
sz
);
// gpu_sync();
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
;
}
hip_ptr
write_to_gpu
(
const
void
*
x
,
std
::
size_t
sz
,
bool
host
=
false
)
{
auto
result
=
allocate_gpu
(
sz
,
host
);
// gpu_sync();
auto
status
=
hipMemcpy
(
result
.
get
(),
x
,
sz
,
hipMemcpyHostToDevice
);
if
(
status
!=
hipSuccess
)
MIGRAPH_THROW
(
"Copy to gpu failed: "
+
hip_error
(
status
));
// 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