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
ae275040
"git@developer.sourcefind.cn:gaoqiong/composable_kernel.git" did not exist on "66e610768de48c56d6bfc5e082c5e1b5a4e4530d"
Commit
ae275040
authored
Oct 05, 2023
by
Adam Osewski
Browse files
Add store and reset functions to workgroup barrier.
parent
030128fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
include/ck/utility/workgroup_barrier.hpp
include/ck/utility/workgroup_barrier.hpp
+15
-1
No files found.
include/ck/utility/workgroup_barrier.hpp
View file @
ae275040
...
@@ -7,7 +7,7 @@ struct workgroup_barrier
...
@@ -7,7 +7,7 @@ struct workgroup_barrier
{
{
__device__
workgroup_barrier
(
uint32_t
*
ptr
)
:
base_ptr
(
ptr
)
{}
__device__
workgroup_barrier
(
uint32_t
*
ptr
)
:
base_ptr
(
ptr
)
{}
__device__
uint32_t
ld
(
uint32_t
offset
)
__device__
uint32_t
ld
(
uint32_t
offset
)
const
{
{
#if 0
#if 0
float d = llvm_amdgcn_raw_buffer_load_fp32(
float d = llvm_amdgcn_raw_buffer_load_fp32(
...
@@ -26,6 +26,11 @@ struct workgroup_barrier
...
@@ -26,6 +26,11 @@ struct workgroup_barrier
return
__atomic_load_n
(
base_ptr
+
offset
,
__ATOMIC_RELAXED
);
return
__atomic_load_n
(
base_ptr
+
offset
,
__ATOMIC_RELAXED
);
}
}
__device__
void
st
(
uint32_t
offset
,
uint32_t
value
)
{
__atomic_store_n
(
base_ptr
+
offset
,
value
,
__ATOMIC_RELEASE
);
}
__device__
void
wait_eq
(
uint32_t
offset
,
uint32_t
value
)
__device__
void
wait_eq
(
uint32_t
offset
,
uint32_t
value
)
{
{
if
(
threadIdx
.
x
==
0
)
if
(
threadIdx
.
x
==
0
)
...
@@ -68,6 +73,15 @@ struct workgroup_barrier
...
@@ -68,6 +73,15 @@ struct workgroup_barrier
}
}
}
}
__device__
void
reset
(
uint32_t
offset
)
{
if
(
threadIdx
.
x
==
0
)
{
st
(
offset
,
0
);
}
__syncthreads
();
}
uint32_t
*
base_ptr
;
uint32_t
*
base_ptr
;
};
};
}
// namespace ck
}
// namespace ck
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