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
1e969c74
Commit
1e969c74
authored
Mar 12, 2019
by
Paul
Browse files
CHeck if workspace has changed
parent
d3a6c95f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
src/targets/gpu/convolution.cpp
src/targets/gpu/convolution.cpp
+8
-3
No files found.
src/targets/gpu/convolution.cpp
View file @
1e969c74
...
@@ -21,7 +21,7 @@ argument miopen_convolution::compute(context& ctx,
...
@@ -21,7 +21,7 @@ argument miopen_convolution::compute(context& ctx,
float
alpha
=
1
;
float
alpha
=
1
;
float
beta
=
0
;
float
beta
=
0
;
miopenConvolutionForward
(
ctx
.
get_stream
().
get_miopen
(),
auto
status
=
miopenConvolutionForward
(
ctx
.
get_stream
().
get_miopen
(),
&
alpha
,
&
alpha
,
x_desc
.
get
(),
x_desc
.
get
(),
args
[
0
].
implicit
(),
args
[
0
].
implicit
(),
...
@@ -34,6 +34,8 @@ argument miopen_convolution::compute(context& ctx,
...
@@ -34,6 +34,8 @@ argument miopen_convolution::compute(context& ctx,
args
[
3
].
implicit
(),
args
[
3
].
implicit
(),
args
[
2
].
implicit
(),
args
[
2
].
implicit
(),
args
[
2
].
get_shape
().
bytes
());
args
[
2
].
get_shape
().
bytes
());
if
(
status
!=
miopenStatusSuccess
)
MIGRAPHX_THROW
(
"Running convolution failed"
);
return
args
[
3
];
return
args
[
3
];
}
}
...
@@ -89,8 +91,11 @@ void miopen_convolution::finalize(context& ctx,
...
@@ -89,8 +91,11 @@ void miopen_convolution::finalize(context& ctx,
{
{
if
(
handle
==
ctx
.
get_stream
().
get_miopen
())
if
(
handle
==
ctx
.
get_stream
().
get_miopen
())
return
;
return
;
// TODO: Check that workspace hasn't changed
// Check that workspace hasn't changed
compile
(
ctx
,
output_shape
,
std
::
move
(
inputs
));
auto
size
=
inputs
.
at
(
2
).
bytes
();
auto
ws
=
compile
(
ctx
,
output_shape
,
std
::
move
(
inputs
));
if
(
ws
.
bytes
()
>
size
)
MIGRAPHX_THROW
(
"Workspace has changed during finalization."
);
}
}
}
// namespace gpu
}
// namespace gpu
...
...
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