Skip to content

Commit

Permalink
Cleanup return values in parsec backend
Browse files Browse the repository at this point in the history
We should not return PARSEC_HOOK_RETURN_NEXT in hooks, only in
the evaluate callback.


Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed May 23, 2024
1 parent f3e8b14 commit 2384e4d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ttg/ttg/parsec/ttg.h
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,8 @@ namespace ttg_parsec {
parsec_ttg_task_t<TT> *me = (parsec_ttg_task_t<TT> *)parsec_task;
return me->template invoke_op<ttg::ExecutionSpace::CUDA>();
} else {
return PARSEC_HOOK_RETURN_NEXT;
std::cerr << "CUDA hook called without having a CUDA op!" << std::endl;
return PARSEC_HOOK_RETURN_ERROR;
}
}

Expand All @@ -776,7 +777,8 @@ namespace ttg_parsec {
parsec_ttg_task_t<TT> *me = (parsec_ttg_task_t<TT> *)parsec_task;
return me->template invoke_op<ttg::ExecutionSpace::HIP>();
} else {
return PARSEC_HOOK_RETURN_NEXT;
std::cerr << "HIP hook called without having a HIP op!" << std::endl;
return PARSEC_HOOK_RETURN_ERROR;
}
}

Expand All @@ -786,7 +788,8 @@ namespace ttg_parsec {
parsec_ttg_task_t<TT> *me = (parsec_ttg_task_t<TT> *)parsec_task;
return me->template invoke_op<ttg::ExecutionSpace::L0>();
} else {
return PARSEC_HOOK_RETURN_NEXT;
std::cerr << "L0 hook called without having a L0 op!" << std::endl;
return PARSEC_HOOK_RETURN_ERROR;
}
}

Expand Down Expand Up @@ -1489,16 +1492,13 @@ namespace ttg_parsec {
task_t *task = (task_t*)parsec_task;
if (task->dev_ptr->gpu_task == nullptr) {

//std::cout << "device_static_op: task " << parsec_task << std::endl;

/* set up a device task */
parsec_gpu_task_t *gpu_task;
/* PaRSEC wants to free the gpu_task, because F***K ownerships */
gpu_task = static_cast<parsec_gpu_task_t*>(std::calloc(1, sizeof(*gpu_task)));
PARSEC_OBJ_CONSTRUCT(gpu_task, parsec_list_item_t);
gpu_task->ec = parsec_task;
gpu_task->task_type = 0; // user task
//gpu_task->load = 1; // TODO: can we do better?
gpu_task->last_data_check_epoch = -1; // used internally
gpu_task->pushout = 0;
gpu_task->submit = &TT::device_static_submit<Space>;
Expand Down

0 comments on commit 2384e4d

Please sign in to comment.