From 0caf3ad47172052f6c32b0ed8691e3db76d974bf Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Mon, 4 Sep 2023 19:04:22 -0700 Subject: [PATCH] Add more comments to vx_spawn.c --- runtime/src/vx_spawn.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/runtime/src/vx_spawn.c b/runtime/src/vx_spawn.c index eb8be09a..a9100c92 100644 --- a/runtime/src/vx_spawn.c +++ b/runtime/src/vx_spawn.c @@ -97,6 +97,8 @@ static void spawn_tasks_rem_cb(int thread_mask) { vx_tmc(1); } +// NOTE(hansung): where is this used? The main section in the POCL binary calls +// `vx_spawn_kernel` but not this one void vx_spawn_tasks(int num_tasks, vx_spawn_tasks_cb callback , void * arg) { // device specs int NC = vx_num_cores(); @@ -281,9 +283,12 @@ void vx_spawn_kernel(context_t * ctx, vx_spawn_kernel_cb callback, void * arg) { char log2X = fast_log2(X); //-- - wspawn_kernel_args_t wspawn_args = { - ctx, callback, arg, core_id * wgs_per_core, fW, rW, 0, isXYpow2, isXpow2, log2XY, log2X - }; + wspawn_kernel_args_t wspawn_args = { + ctx, callback, arg, core_id * wgs_per_core /*offset*/, + fW /*N*/, rW /*R*/, 0 /*NW*/, isXYpow2, + isXpow2, log2XY, log2X}; + + // NOTE(hansung): core_id is capped at NUM_CORES_MAX = 32 g_wspawn_args[core_id] = &wspawn_args; //-- @@ -304,4 +309,4 @@ void vx_spawn_kernel(context_t * ctx, vx_spawn_kernel_cb callback, void * arg) { #ifdef __cplusplus } -#endif \ No newline at end of file +#endif