Add convergent attribute to vx_barrier
Note this attribute is only supported by Clang, so this will only be applied to the kernel binary but not runtime.
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
// #define SMEM_SIZE 0x4000
|
||||
// 64KB
|
||||
// #define SMEM_SIZE 0x10000
|
||||
// 128KB
|
||||
// #define SMEM_SIZE 0x20000
|
||||
// 256KB
|
||||
#define SMEM_SIZE 0x40000
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ inline void vx_join(unsigned stack_ptr) {
|
||||
}
|
||||
|
||||
// Warp Barrier
|
||||
__attribute__((convergent))
|
||||
inline void vx_barrier(unsigned barried_id, unsigned num_warps) {
|
||||
asm volatile (".insn r %0, 4, 0, x0, %1, %2" :: "i"(RISCV_CUSTOM0), "r"(barried_id), "r"(num_warps));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user