Skip to content

Commit

Permalink
TL/CUDA: replace free tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ikryukov committed Nov 8, 2024
1 parent f2404db commit f4f1e5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/components/tl/cuda/tl_cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ UCC_CLASS_DECLARE(ucc_tl_cuda_context_t, const ucc_base_context_params_t *,

typedef uint32_t ucc_tl_cuda_sync_state_t;

#define UCC_TAG_FREE 0xFFFFFFFF

typedef struct ucc_tl_cuda_shm_barrier {
ucc_rank_t size;
ucc_rank_t count;
Expand Down
4 changes: 2 additions & 2 deletions src/components/tl/cuda/tl_cuda_coll.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static inline void ucc_tl_cuda_task_put(ucc_tl_cuda_task_t *task)

if (UCC_TL_TEAM_RANK(TASK_TEAM(task)) == task->bcast_linear.root) {
ucc_print("free bar!");
task->bar->tag = 0;
task->bar->tag = UCC_TAG_FREE;
}

ucc_mpool_put(task);
Expand Down Expand Up @@ -135,7 +135,7 @@ ucc_status_t ucc_tl_cuda_task_init(ucc_base_coll_args_t *coll_args,
/* search first free barrier in active set pool */
for (i = 0; i < max_concurrent; ++i) {
curr_bar = UCC_TL_CUDA_TEAM_BARRIER(team, max_concurrent + i);
if (ucc_atomic_cswap32(&curr_bar->tag, 0, coll_args->args.tag) == 0) {
if (ucc_atomic_cswap32(&curr_bar->tag, UCC_TAG_FREE, coll_args->args.tag) == UCC_TAG_FREE) {
ucc_print("found free barrier: %d", i);
// free
task->bar = curr_bar;
Expand Down

0 comments on commit f4f1e5a

Please sign in to comment.