Skip to content
Snippets Groups Projects
Verified Commit 2a317de4 authored by raphael.bach's avatar raphael.bach
Browse files

Make `fmpi_task_register()` add task to `fmpi_ctx`

parent f2c5b7fd
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,11 @@
* Maximum number of arguments that can be passed to a task.
*/
#define FMPI_TASK_ARGS_CNT_MAX 32
/**
* Maximum number of tasks that can be created.
* @todo Find a meaningful value.
*/
#define FMPI_TASK_MAX 32
/*==============================================================================
TYPE
==============================================================================*/
......
......@@ -47,7 +47,7 @@
typedef struct fmpi_ctx {
struct fmpi_mpi_ctx * mpi; //!< TODO
struct fmpi_futhark_ctx * fut; //!< TODO
struct fmpi_task tasks[32];
struct fmpi_task tasks[FMPI_TASK_MAX];
size_t task_cnt;
double timer_start; //!< TODO
double timer_stop; //!< TODO
......
......@@ -44,6 +44,7 @@ struct fmpi_task fmpi_task_register(
const struct fmpi_task_args * const args
){
assert(ctx != NULL);
assert(ctx->task_cnt < FMPI_TASK_MAX);
assert(args != NULL);
struct fmpi_task task = {
.func = func,
......@@ -61,6 +62,7 @@ struct fmpi_task fmpi_task_register(
);
task.args.in[i].start = start;
}
ctx->tasks[ctx->task_cnt++] = task;
futhark_context_sync(ctx->fut->ctx);
return task;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment