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:
Hansung Kim
2024-10-02 10:57:45 -07:00
parent 221d5f75c2
commit 6f6ee5616f
2 changed files with 3 additions and 0 deletions

View File

@@ -9,6 +9,8 @@
// #define SMEM_SIZE 0x4000
// 64KB
// #define SMEM_SIZE 0x10000
// 128KB
// #define SMEM_SIZE 0x20000
// 256KB
#define SMEM_SIZE 0x40000

View File

@@ -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));
}