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
206b9a51
Unverified
Commit
206b9a51
authored
Mar 09, 2023
by
Paul Fultz II
Committed by
GitHub
Mar 09, 2023
Browse files
Fix static_assert in large reduction (#1604)
parent
3ad6132c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
src/targets/gpu/jit/reduce.cpp
src/targets/gpu/jit/reduce.cpp
+1
-1
test/verify/test_reduce_op_large.cpp
test/verify/test_reduce_op_large.cpp
+14
-1
No files found.
src/targets/gpu/jit/reduce.cpp
View file @
206b9a51
...
@@ -127,7 +127,7 @@ struct reduce_compiler : compiler<reduce_compiler>
...
@@ -127,7 +127,7 @@ struct reduce_compiler : compiler<reduce_compiler>
vec
=
vectorize
::
elements
(
ctx
,
faxis
,
options
.
virtual_inputs
);
vec
=
vectorize
::
elements
(
ctx
,
faxis
,
options
.
virtual_inputs
);
auto
relements
=
get_reduce_elements
(
options
.
virtual_inputs
)
/
vec
.
size
;
auto
relements
=
get_reduce_elements
(
options
.
virtual_inputs
)
/
vec
.
size
;
auto
block_size
=
compute_block_size
(
relements
,
256
);
auto
block_size
=
compute_block_size
(
relements
,
256
);
if
(
relements
>
block_size
*
256
)
if
(
relements
>
=
block_size
*
256
)
algo
=
"block_large"
;
algo
=
"block_large"
;
options
.
set_launch_params
(
options
.
set_launch_params
(
v
,
compute_global_for
(
ctx
,
nelements
*
block_size
,
256
),
block_size
);
v
,
compute_global_for
(
ctx
,
nelements
*
block_size
,
256
),
block_size
);
...
...
test/verify/test_reduce_op_large.cpp
View file @
206b9a51
...
@@ -77,7 +77,7 @@ struct test_reduce_mean_2 : verify_program<test_reduce_mean_2>
...
@@ -77,7 +77,7 @@ struct test_reduce_mean_2 : verify_program<test_reduce_mean_2>
};
};
};
};
struct
test_large_reduce_mean
:
verify_program
<
test_large_reduce_mean
>
struct
test_large_reduce_mean
1
:
verify_program
<
test_large_reduce_mean
1
>
{
{
migraphx
::
program
create_program
()
const
migraphx
::
program
create_program
()
const
{
{
...
@@ -89,3 +89,16 @@ struct test_large_reduce_mean : verify_program<test_large_reduce_mean>
...
@@ -89,3 +89,16 @@ struct test_large_reduce_mean : verify_program<test_large_reduce_mean>
return
p
;
return
p
;
};
};
};
};
struct
test_large_reduce_mean2
:
verify_program
<
test_large_reduce_mean2
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
1
,
32
,
262144
}};
auto
x
=
mm
->
add_parameter
(
"x"
,
s
);
mm
->
add_instruction
(
migraphx
::
op
::
reduce_mean
{{
2
}},
x
);
return
p
;
};
};
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