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_ROCM
Commits
b0f295cb
Commit
b0f295cb
authored
Jul 31, 2024
by
Jing Zhang
Browse files
fixed global_atomic_add
parent
895e8c40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
include/ck/utility/amd_buffer_addressing.hpp
include/ck/utility/amd_buffer_addressing.hpp
+8
-0
No files found.
include/ck/utility/amd_buffer_addressing.hpp
View file @
b0f295cb
...
@@ -568,6 +568,7 @@ __device__ void amd_global_atomic_add_impl(const typename vector_type<T, N>::typ
...
@@ -568,6 +568,7 @@ __device__ void amd_global_atomic_add_impl(const typename vector_type<T, N>::typ
{
{
if
constexpr
(
is_same
<
T
,
half_t
>::
value
)
if
constexpr
(
is_same
<
T
,
half_t
>::
value
)
{
{
#if 0
if constexpr(N == 2)
if constexpr(N == 2)
{
{
__builtin_amdgcn_global_atomic_fadd_v2f16(addr, src_thread_data);
__builtin_amdgcn_global_atomic_fadd_v2f16(addr, src_thread_data);
...
@@ -586,6 +587,13 @@ __device__ void amd_global_atomic_add_impl(const typename vector_type<T, N>::typ
...
@@ -586,6 +587,13 @@ __device__ void amd_global_atomic_add_impl(const typename vector_type<T, N>::typ
__builtin_amdgcn_global_atomic_fadd_v2f16(addr + i, tmp.AsType<half2_t>()[i]);
__builtin_amdgcn_global_atomic_fadd_v2f16(addr + i, tmp.AsType<half2_t>()[i]);
});
});
}
}
#else
static_assert
(
N
%
2
==
0
,
""
);
vector_type
<
half_t
,
N
>
tmp
{
src_thread_data
};
static_for
<
0
,
N
/
2
,
1
>
{}([
&
](
auto
i
)
{
__builtin_amdgcn_global_atomic_fadd_v2f16
(
bit_cast
<
half2_t
*>
(
addr
)
+
i
,
tmp
.
template
AsType
<
half2_t
>()[
i
]);
});
#endif
}
}
}
}
...
...
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