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
33716162
Commit
33716162
authored
Jul 06, 2022
by
Paul
Browse files
Try to fuse pk instructions with dpp
parent
f2531606
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
src/targets/gpu/kernels/include/migraphx/kernels/reduce.hpp
src/targets/gpu/kernels/include/migraphx/kernels/reduce.hpp
+10
-9
No files found.
src/targets/gpu/kernels/include/migraphx/kernels/reduce.hpp
View file @
33716162
...
@@ -80,19 +80,20 @@ __device__ void dpp_reduce(T& in, Op op)
...
@@ -80,19 +80,20 @@ __device__ void dpp_reduce(T& in, Op op)
// NOLINTNEXTLINE
// NOLINTNEXTLINE
#define MIGRAPHX_DPP_REDUCE(op, prefix) \
#define MIGRAPHX_DPP_REDUCE(op, prefix) \
__device__ inline void dpp_reduce(double& x, op) { MIGRAPHX_DPP_REDUCE_ASM(x, prefix##_f64); } \
__device__ inline void dpp_reduce(double& x, op) { MIGRAPHX_DPP_REDUCE_ASM(x,
v_##
prefix##_f64); } \
__device__ inline void dpp_reduce(float& x, op) { MIGRAPHX_DPP_REDUCE_ASM(x, prefix##_f32); } \
__device__ inline void dpp_reduce(float& x, op) { MIGRAPHX_DPP_REDUCE_ASM(x,
v_##
prefix##_f32); } \
__device__ inline void dpp_reduce(half& x, op) { MIGRAPHX_DPP_REDUCE_ASM(x, prefix##_f16); } \
__device__ inline void dpp_reduce(half& x, op) { MIGRAPHX_DPP_REDUCE_ASM(x,
v_##
prefix##_f16); } \
__device__ inline void dpp_reduce(int32_t& x, op) \
__device__ inline void dpp_reduce(int32_t& x, op) \
{ \
{ \
MIGRAPHX_DPP_REDUCE_ASM(x, prefix##_u32); \
MIGRAPHX_DPP_REDUCE_ASM(x,
v_##
prefix##_u32); \
} \
} \
__device__ inline void dpp_reduce(uint32_t& x, op) { MIGRAPHX_DPP_REDUCE_ASM(x, prefix##_u32); }
__device__ inline void dpp_reduce(uint32_t& x, op) { MIGRAPHX_DPP_REDUCE_ASM(x, v_##prefix##_u32); } \
__device__ inline void dpp_reduce(vec<half, 2>& x, op) { MIGRAPHX_DPP_REDUCE_ASM(x, v_pk_##prefix##_f16); }
MIGRAPHX_DPP_REDUCE
(
op
::
sum
,
v_
add
)
MIGRAPHX_DPP_REDUCE
(
op
::
sum
,
add
)
MIGRAPHX_DPP_REDUCE
(
op
::
max
,
v_
max
)
MIGRAPHX_DPP_REDUCE
(
op
::
max
,
max
)
MIGRAPHX_DPP_REDUCE
(
op
::
min
,
v_
min
)
MIGRAPHX_DPP_REDUCE
(
op
::
min
,
min
)
MIGRAPHX_DPP_REDUCE
(
op
::
product
,
v_
mul
)
MIGRAPHX_DPP_REDUCE
(
op
::
product
,
mul
)
template
<
class
Op
,
class
T
,
class
F
>
template
<
class
Op
,
class
T
,
class
F
>
__device__
auto
block_reduce
(
index
idx
,
Op
op
,
T
init
,
index_int
n
,
F
f
)
__device__
auto
block_reduce
(
index
idx
,
Op
op
,
T
init
,
index_int
n
,
F
f
)
...
...
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