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
composable_kernel
Commits
7218a2b7
Commit
7218a2b7
authored
Sep 18, 2021
by
Qianfeng Zhang
Browse files
Occasional tiny simplification and update in the kernel files
parent
7a7497f9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
22 deletions
+3
-22
composable_kernel/include/utility/reduction_common.hpp
composable_kernel/include/utility/reduction_common.hpp
+2
-21
composable_kernel/src/kernel_wrapper/gridwise_generic_reduction_first_call_blockwise_reduce_all_dims.cpp
...eneric_reduction_first_call_blockwise_reduce_all_dims.cpp
+1
-1
No files found.
composable_kernel/include/utility/reduction_common.hpp
View file @
7218a2b7
...
...
@@ -28,13 +28,6 @@
// this enumerate should be synchronized with include/miopen/reduce_common.hpp
namespace
ck
{
enum
class
ReductionMethod_t
{
DirectThreadWise
=
1
,
DirectWarpWise
=
2
,
BlockWise
=
3
,
MultiBlock
=
4
};
// end of namespace ck
enum
class
ReduceTensorOp_t
{
...
...
@@ -71,31 +64,19 @@ enum class IndicesType_t
struct
float_equal_one
{
template
<
class
T
>
__device__
static
inline
bool
apply
(
T
x
)
{
return
x
<=
type_convert
<
T
>
{}(
1.0
f
)
and
x
>=
type_convert
<
T
>
{}(
1.0
f
);
}
template
<
class
T
>
__device__
inline
bool
operator
()(
T
x
)
{
return
(
float_equal_one
::
apply
(
x
)
);
return
x
<=
static_cast
<
T
>
(
1.0
f
)
and
x
>=
static_cast
<
T
>
(
1.0
f
);
};
};
struct
float_equal_zero
{
template
<
class
T
>
__device__
static
inline
bool
apply
(
T
x
)
{
return
x
<=
type_convert
<
T
>
{}(
0.0
f
)
and
x
>=
type_convert
<
T
>
{}(
0.0
f
);
}
template
<
class
T
>
__device__
inline
bool
operator
()(
T
x
)
{
return
(
float_equal_zero
::
apply
(
x
)
);
return
x
<=
static_cast
<
T
>
(
0.0
f
)
and
x
>=
static_cast
<
T
>
(
0.0
f
);
};
};
...
...
composable_kernel/src/kernel_wrapper/gridwise_generic_reduction_first_call_blockwise_reduce_all_dims.cpp
View file @
7218a2b7
...
...
@@ -253,7 +253,7 @@ using refType_src2dDesc_padded_34 =
using
refType_dst1dDesc_padded
=
typename
get_ref_desc_types
<
srcDims
,
dstDims
,
toReduceDims
>::
refType_dst1dDesc_padded
;
template
<
ReductionMethod_t
impl
,
bool
need_padding
>
template
<
bool
need_padding
>
static
__device__
auto
get_reduction_src2d_descriptor
(
const
void
*
p_src2dDesc
)
{
if
constexpr
(
need_padding
)
...
...
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