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
78cb524d
Commit
78cb524d
authored
Aug 20, 2019
by
Paul
Browse files
Fix incorrect stride calculation in reduce_mean
parent
95050fbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
src/targets/gpu/device/include/migraphx/gpu/device/reduce.hpp
...targets/gpu/device/include/migraphx/gpu/device/reduce.hpp
+1
-4
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+12
-0
No files found.
src/targets/gpu/device/include/migraphx/gpu/device/reduce.hpp
View file @
78cb524d
...
@@ -282,10 +282,7 @@ void reduce(hipStream_t stream,
...
@@ -282,10 +282,7 @@ void reduce(hipStream_t stream,
std
::
prev
(
output_shape
.
lens
().
end
()),
std
::
prev
(
output_shape
.
lens
().
end
()),
input_shape
.
lens
().
begin
()))
input_shape
.
lens
().
begin
()))
{
{
std
::
size_t
stride
=
std
::
accumulate
(
input_shape
.
strides
().
begin
(),
std
::
size_t
stride
=
input_shape
.
strides
().
at
(
input_shape
.
strides
().
size
()
-
2
);
input_shape
.
strides
().
end
(),
1
,
std
::
multiplies
<
size_t
>
());
reduce_standard_impl
(
stream
,
reduce_standard_impl
(
stream
,
result
,
result
,
arg
,
arg
,
...
...
test/gpu/miopen.cpp
View file @
78cb524d
...
@@ -3792,6 +3792,18 @@ struct test_reduce_mean : verify_program<test_reduce_mean>
...
@@ -3792,6 +3792,18 @@ struct test_reduce_mean : verify_program<test_reduce_mean>
};
};
};
};
struct
test_reduce_mean2
:
verify_program
<
test_reduce_mean2
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
1
,
128
,
768
}};
auto
x
=
p
.
add_parameter
(
"x"
,
s
);
p
.
add_instruction
(
migraphx
::
op
::
reduce_mean
{{
2
}},
x
);
return
p
;
};
};
struct
test_reduce_mean_int
:
verify_program
<
test_reduce_mean_int
>
struct
test_reduce_mean_int
:
verify_program
<
test_reduce_mean_int
>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
...
...
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