|
@@ -1,7 +1,7 @@
|
|
|
/* StarPU --- Runtime system for heterogeneous multicore architectures.
|
|
|
*
|
|
|
* Copyright (C) 2009, 2010 Université de Bordeaux 1
|
|
|
- * Copyright (C) 2010 Centre National de la Recherche Scientifique
|
|
|
+ * Copyright (C) 2010, 2011 Centre National de la Recherche Scientifique
|
|
|
*
|
|
|
* StarPU is free software; you can redistribute it and/or modify
|
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
@@ -21,6 +21,7 @@
|
|
|
#include <unistd.h>
|
|
|
|
|
|
#include <starpu.h>
|
|
|
+#include "../common/helper.h"
|
|
|
|
|
|
static starpu_tag_t tagA = 0x0042;
|
|
|
static starpu_tag_t tagB = 0x1042;
|
|
@@ -33,7 +34,7 @@ static void dummy_func(void *descr[] __attribute__ ((unused)), void *arg __attri
|
|
|
{
|
|
|
}
|
|
|
|
|
|
-static starpu_codelet dummy_codelet =
|
|
|
+static starpu_codelet dummy_codelet =
|
|
|
{
|
|
|
.where = STARPU_CPU|STARPU_CUDA|STARPU_OPENCL,
|
|
|
.cpu_func = dummy_func,
|
|
@@ -45,19 +46,22 @@ static starpu_codelet dummy_codelet =
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
{
|
|
|
- starpu_init(NULL);
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ ret = starpu_init(NULL);
|
|
|
+ STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
|
|
|
|
|
|
/* {A,B,C} -> D -> {E,F}, D is empty */
|
|
|
struct starpu_task *taskA = starpu_task_create();
|
|
|
taskA->cl = &dummy_codelet;
|
|
|
taskA->use_tag = 1;
|
|
|
taskA->tag_id = tagA;
|
|
|
-
|
|
|
+
|
|
|
struct starpu_task *taskB = starpu_task_create();
|
|
|
taskB->cl = &dummy_codelet;
|
|
|
taskB->use_tag = 1;
|
|
|
taskB->tag_id = tagB;
|
|
|
-
|
|
|
+
|
|
|
struct starpu_task *taskC = starpu_task_create();
|
|
|
taskC->cl = &dummy_codelet;
|
|
|
taskC->use_tag = 1;
|
|
@@ -81,12 +85,12 @@ int main(int argc, char **argv)
|
|
|
taskF->tag_id = tagF;
|
|
|
starpu_tag_declare_deps(tagF, 1, tagD);
|
|
|
|
|
|
- starpu_task_submit(taskA);
|
|
|
- starpu_task_submit(taskB);
|
|
|
- starpu_task_submit(taskC);
|
|
|
- starpu_task_submit(taskD);
|
|
|
- starpu_task_submit(taskE);
|
|
|
- starpu_task_submit(taskF);
|
|
|
+ ret = starpu_task_submit(taskA); STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
|
|
|
+ ret = starpu_task_submit(taskB); STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
|
|
|
+ ret = starpu_task_submit(taskC); STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
|
|
|
+ ret = starpu_task_submit(taskD); STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
|
|
|
+ ret = starpu_task_submit(taskE); STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
|
|
|
+ ret = starpu_task_submit(taskF); STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
|
|
|
|
|
|
starpu_tag_t tag_array[2] = {tagE, tagF};
|
|
|
starpu_tag_wait_array(2, tag_array);
|