Skip to content

Commit

Permalink
refs #6: Revive no-opped kernel execution and more comments.
Browse files Browse the repository at this point in the history
 * Now the performance gets affected by computation.
  • Loading branch information
achimnol committed Jan 13, 2016
1 parent 1147178 commit 6612281
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/lib/elementgraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ void ElementGraph::send_offload_task_to_device(OffloadTask *task)
task->prepare_read_buffer();
task->prepare_write_buffer();
task->state = TASK_PREPARED;
} /* endif(!task.prepared) */
}

/* Send the offload task to device thread. */
assert(task->state == TASK_PREPARED);
int ret = rte_ring_enqueue(ctx->offload_input_queues[dev_idx], (void*) task);
if (ret == -ENOBUFS) {
/* The input queue is full. Delay the task. */
enqueue_offload_task(task, task->tracker.element, task->tracker.input_port);
} else {
/* It may return -EDQUOT, but here we ignore this HWM signal.
Expand Down
3 changes: 2 additions & 1 deletion src/lib/io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ static void comp_offload_task_completion_cb(struct ev_loop *loop, struct ev_asyn
((float) task_cycles / total_batch_size
- ((float) task->batches[b]->delay_time / task->batches[b]->count));
}
/* We need to rewind the state so that it gets executed by ElemGraph. */
/* Rewind the state so that it gets "prepared" by ElemGraph.
* (e.g., update datablock list used by next element) */
task->state = TASK_INITIALIZED;
ctx->elem_graph->enqueue_offload_task(task,
ctx->elem_graph->get_first_next(task->elem),
Expand Down
12 changes: 6 additions & 6 deletions src/lib/offloadtask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,13 @@ void OffloadTask::execute()
arg = {(void *) &checkbits_d, sizeof(void *), alignof(void *)};
cctx->push_kernel_arg(arg);

//offload_compute_handler &handler = elem->offload_compute_handlers[cctx->type_name];
//handler(cctx, &res);
offload_compute_handler &handler = elem->offload_compute_handlers[cctx->type_name];
handler(cctx, &res);
/* Skip kernel execution. */
res.num_workitems = 0;
res.num_threads_per_workgroup = 1;
res.num_workgroups = 1;
cctx->get_host_checkbits()[0] = 1;
//res.num_workitems = 0;
//res.num_threads_per_workgroup = 1;
//res.num_workgroups = 1;
//cctx->get_host_checkbits()[0] = 1;

} else {

Expand Down

0 comments on commit 6612281

Please sign in to comment.