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
bfdda4fe
"src/vscode:/vscode.git/clone" did not exist on "765506ce2805442e9765bed6f92292c572a5c62a"
Commit
bfdda4fe
authored
Feb 16, 2024
by
illsilin
Browse files
update s_barrier and s_waitcnt for gfx12
parent
22509c0b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
include/ck/tensor_operation/gpu/block/blockwise_gemm_xdlops.hpp
...e/ck/tensor_operation/gpu/block/blockwise_gemm_xdlops.hpp
+7
-0
include/ck/utility/synchronization.hpp
include/ck/utility/synchronization.hpp
+17
-0
No files found.
include/ck/tensor_operation/gpu/block/blockwise_gemm_xdlops.hpp
View file @
bfdda4fe
...
@@ -479,7 +479,14 @@ struct BlockwiseGemmXdlopsInterwave_k0mk1_k0nk1_m0n0m1n1m2m3m4n2_v1
...
@@ -479,7 +479,14 @@ struct BlockwiseGemmXdlopsInterwave_k0mk1_k0nk1_m0n0m1n1m2m3m4n2_v1
// sync point.
// sync point.
if
constexpr
(
k
.
value
!=
0
||
KPerInnerLoop
==
KPerThread
)
if
constexpr
(
k
.
value
!=
0
||
KPerInnerLoop
==
KPerThread
)
{
{
#ifdef __gfx12__
asm
volatile
(
"\
s_barrier_signal
\n
\
s_barrier_wait \
"
::
);
#else
asm
volatile
(
"s_barrier"
::
);
asm
volatile
(
"s_barrier"
::
);
#endif
__builtin_amdgcn_sched_barrier
(
0
);
__builtin_amdgcn_sched_barrier
(
0
);
}
}
static_for
<
0
,
KPerInnerLoop
,
KPack
>
{}([
&
](
auto
k_
)
{
static_for
<
0
,
KPerInnerLoop
,
KPack
>
{}([
&
](
auto
k_
)
{
...
...
include/ck/utility/synchronization.hpp
View file @
bfdda4fe
...
@@ -10,10 +10,18 @@ namespace ck {
...
@@ -10,10 +10,18 @@ namespace ck {
__device__
void
block_sync_lds
()
__device__
void
block_sync_lds
()
{
{
#if CK_EXPERIMENTAL_BLOCK_SYNC_LDS_WITHOUT_SYNC_VMEM
#if CK_EXPERIMENTAL_BLOCK_SYNC_LDS_WITHOUT_SYNC_VMEM
#ifdef __gfx12__
asm
volatile
(
"\
s_wait_idle lgkmcnt(0)
\n
\
s_barrier_signal
\n
\
s_barrier_wait \
"
::
);
#else
asm
volatile
(
"\
asm
volatile
(
"\
s_waitcnt lgkmcnt(0)
\n
\
s_waitcnt lgkmcnt(0)
\n
\
s_barrier \
s_barrier \
"
::
);
"
::
);
#endif
#else
#else
__syncthreads
();
__syncthreads
();
#endif
#endif
...
@@ -21,11 +29,20 @@ __device__ void block_sync_lds()
...
@@ -21,11 +29,20 @@ __device__ void block_sync_lds()
__device__
void
block_sync_lds_direct_load
()
__device__
void
block_sync_lds_direct_load
()
{
{
#ifdef __gfx12__
asm
volatile
(
"\
s_wait_idle vmcnt(0)
\n
\
s_wait_idle lgkmcnt(0)
\n
\
s_barrier_signal
\n
\
s_barrier_wait \
"
::
);
#else
asm
volatile
(
"\
asm
volatile
(
"\
s_waitcnt vmcnt(0)
\n
\
s_waitcnt vmcnt(0)
\n
\
s_waitcnt lgkmcnt(0)
\n
\
s_waitcnt lgkmcnt(0)
\n
\
s_barrier \
s_barrier \
"
::
);
"
::
);
#endif
}
}
__device__
void
s_nop
()
__device__
void
s_nop
()
...
...
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