Skip to content

Commit

Permalink
TL/CUDA: fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ikryukov committed Jul 6, 2024
1 parent 86f6622 commit d1b4baa
Showing 1 changed file with 22 additions and 27 deletions.
49 changes: 22 additions & 27 deletions src/components/tl/cuda/bcast/bcast_linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

#include "bcast/bcast.h"

enum {
enum
{
STAGE_DONE,
STAGE_SYNC,
STAGE_SETUP,
Expand Down Expand Up @@ -68,7 +69,7 @@ static inline size_t get_raw_scratch_size(ucc_tl_cuda_team_t *team)
}

static inline ucc_status_t ecopy(void *dst, void *src, size_t size,
ucc_ee_executor_t *exec,
ucc_ee_executor_t * exec,
ucc_ee_executor_task_t **etask)
{
ucc_ee_executor_task_args_t exec_args = {0};
Expand Down Expand Up @@ -97,10 +98,10 @@ void ucc_tl_cuda_bcast_linear_progress(ucc_coll_task_t *coll_task)
ucc_rank_t tsize = UCC_TL_TEAM_SIZE(team);
// ucc_datatype_t dt = task->bcast_linear.dt;

ucc_ee_executor_t *exec;
ucc_ee_executor_t * exec;
ucc_ee_executor_task_t *etask;
ucc_status_t st;
void *sbuf, *dbuf;
void * sbuf, *dbuf;
task->super.status = UCC_INPROGRESS;

st = ucc_coll_task_get_executor(&task->super, &exec);
Expand Down Expand Up @@ -158,9 +159,8 @@ void ucc_tl_cuda_bcast_linear_progress(ucc_coll_task_t *coll_task)
dbuf = TASK_SCRATCH(task, trank);
sbuf = PTR_OFFSET(task->bcast_linear.sbuf, offset_buff);
st = ecopy(dbuf, sbuf, chunk_size, exec,
&task->bcast_linear.exec_task);
if (st != UCC_OK)
{
&task->bcast_linear.exec_task);
if (st != UCC_OK) {
ucc_error("failed to post ecopy task");
task->super.status = st;
return;
Expand All @@ -179,15 +179,11 @@ void ucc_tl_cuda_bcast_linear_progress(ucc_coll_task_t *coll_task)
set_rank_step(task, task->bcast_linear.root,
task->bcast_linear.step, 0);
task->bcast_linear.stage = STAGE_WAIT_ALL;
}
else
{
} else {
// ucc_info("not ready");
return;
}
}
else
{
} else {
ucc_info("etask is nullptr");
return;
}
Expand Down Expand Up @@ -226,9 +222,7 @@ void ucc_tl_cuda_bcast_linear_progress(ucc_coll_task_t *coll_task)
// ucc_info("something from root is ready!");
task->bcast_linear.stage = STAGE_CLIENT_COPY;
break;
}
else
{
} else {
return;
}
// break;
Expand All @@ -238,8 +232,13 @@ void ucc_tl_cuda_bcast_linear_progress(ucc_coll_task_t *coll_task)
task,
task->bcast_linear
.root); // need to copy from root's scratch buffer
st = ecopy(dbuf, sbuf, chunk_size, exec,
&task->bcast_linear.exec_task);
st = ecopy(dbuf, sbuf, chunk_size, exec,
&task->bcast_linear.exec_task);
if (st != UCC_OK) {
ucc_error("failed to post ecopy task at client");
task->super.status = st;
return;
}
task->bcast_linear.stage = STAGE_CLIENT_COPY_WAIT;
// break;
case STAGE_CLIENT_COPY_WAIT:
Expand All @@ -258,14 +257,10 @@ void ucc_tl_cuda_bcast_linear_progress(ucc_coll_task_t *coll_task)
} else {
task->bcast_linear.stage = STAGE_DONE;
}
}
else
{
} else {
return;
}
}
else
{
} else {
return;
}
// break;
Expand All @@ -282,7 +277,7 @@ ucc_status_t ucc_tl_cuda_bcast_linear_start(ucc_coll_task_t *coll_task)
{
ucc_tl_cuda_task_t *task = ucc_derived_of(coll_task, ucc_tl_cuda_task_t);
ucc_tl_cuda_team_t *team = TASK_TEAM(task);
ucc_coll_args_t *args = &TASK_ARGS(task);
ucc_coll_args_t * args = &TASK_ARGS(task);
// ucc_rank_t tsize = UCC_TL_TEAM_SIZE(team);
ucc_datatype_t dt = task->bcast_linear.dt;

Expand All @@ -306,8 +301,8 @@ ucc_status_t ucc_tl_cuda_bcast_linear_start(ucc_coll_task_t *coll_task)
}

ucc_status_t ucc_tl_cuda_bcast_linear_init(ucc_base_coll_args_t *coll_args,
ucc_base_team_t *tl_team,
ucc_coll_task_t **task_p)
ucc_base_team_t * tl_team,
ucc_coll_task_t ** task_p)
{
ucc_tl_cuda_team_t *team = ucc_derived_of(tl_team, ucc_tl_cuda_team_t);
ucc_tl_cuda_task_t *task;
Expand Down

0 comments on commit d1b4baa

Please sign in to comment.