|
@@ -150,6 +150,7 @@ create_and_submit_tasks(int where, starpu_data_handle_t handles[])
|
|
FPRINTF(stderr, "***** Starting Task 1\n");
|
|
FPRINTF(stderr, "***** Starting Task 1\n");
|
|
static struct starpu_codelet cl =
|
|
static struct starpu_codelet cl =
|
|
{
|
|
{
|
|
|
|
+ .modes[0] = STARPU_RW,
|
|
#ifdef STARPU_USE_CUDA
|
|
#ifdef STARPU_USE_CUDA
|
|
.cuda_funcs = {cuda_func, NULL},
|
|
.cuda_funcs = {cuda_func, NULL},
|
|
#endif
|
|
#endif
|
|
@@ -163,13 +164,13 @@ create_and_submit_tasks(int where, starpu_data_handle_t handles[])
|
|
struct starpu_task *task = starpu_task_create();
|
|
struct starpu_task *task = starpu_task_create();
|
|
task->synchronous = SYNCHRONOUS;
|
|
task->synchronous = SYNCHRONOUS;
|
|
task->cl = &cl;
|
|
task->cl = &cl;
|
|
- task->buffers[0].handle = handles[0];
|
|
|
|
- task->buffers[0].mode = STARPU_RW;
|
|
|
|
|
|
+ task->handles[0] = handles[0];
|
|
starpu_task_submit(task);
|
|
starpu_task_submit(task);
|
|
|
|
|
|
FPRINTF(stderr, "***** Starting Task 2\n");
|
|
FPRINTF(stderr, "***** Starting Task 2\n");
|
|
static struct starpu_codelet cl2 =
|
|
static struct starpu_codelet cl2 =
|
|
{
|
|
{
|
|
|
|
+ .modes[0] = STARPU_RW,
|
|
.where = STARPU_CPU,
|
|
.where = STARPU_CPU,
|
|
.cpu_funcs = {cpu_func, NULL},
|
|
.cpu_funcs = {cpu_func, NULL},
|
|
.nbuffers = 1
|
|
.nbuffers = 1
|
|
@@ -178,14 +179,15 @@ create_and_submit_tasks(int where, starpu_data_handle_t handles[])
|
|
struct starpu_task *task2 = starpu_task_create();
|
|
struct starpu_task *task2 = starpu_task_create();
|
|
task2->synchronous = SYNCHRONOUS;
|
|
task2->synchronous = SYNCHRONOUS;
|
|
task2->cl = &cl2;
|
|
task2->cl = &cl2;
|
|
- task2->buffers[0].handle = handles[1];
|
|
|
|
- task2->buffers[0].mode = STARPU_RW;
|
|
|
|
|
|
+ task2->handles[0] = handles[1];
|
|
starpu_task_submit(task2);
|
|
starpu_task_submit(task2);
|
|
|
|
|
|
|
|
|
|
FPRINTF(stderr, "***** Starting Task 3\n");
|
|
FPRINTF(stderr, "***** Starting Task 3\n");
|
|
static struct starpu_codelet cl3 =
|
|
static struct starpu_codelet cl3 =
|
|
{
|
|
{
|
|
|
|
+ .modes[1] = STARPU_RW,
|
|
|
|
+ .modes[0] = STARPU_RW,
|
|
.cpu_funcs = {cpu_func, NULL},
|
|
.cpu_funcs = {cpu_func, NULL},
|
|
#ifdef STARPU_USE_CUDA
|
|
#ifdef STARPU_USE_CUDA
|
|
.cuda_funcs = {cuda_func, NULL},
|
|
.cuda_funcs = {cuda_func, NULL},
|
|
@@ -200,10 +202,8 @@ create_and_submit_tasks(int where, starpu_data_handle_t handles[])
|
|
struct starpu_task *task3 = starpu_task_create();
|
|
struct starpu_task *task3 = starpu_task_create();
|
|
task3->synchronous = SYNCHRONOUS;
|
|
task3->synchronous = SYNCHRONOUS;
|
|
task3->cl = &cl3;
|
|
task3->cl = &cl3;
|
|
- task3->buffers[0].handle = handles[0];
|
|
|
|
- task3->buffers[0].mode = STARPU_RW;
|
|
|
|
- task3->buffers[1].handle = handles[1];
|
|
|
|
- task3->buffers[1].mode = STARPU_RW;
|
|
|
|
|
|
+ task3->handles[0] = handles[0];
|
|
|
|
+ task3->handles[1] = handles[1];
|
|
starpu_task_submit(task3);
|
|
starpu_task_submit(task3);
|
|
|
|
|
|
starpu_task_wait_for_all();
|
|
starpu_task_wait_for_all();
|