Olivier Aumage лет назад: 8
Родитель
Сommit
f0c0dfeb76
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      examples/sched_ctx/nested_sched_ctxs.c

+ 4 - 1
examples/sched_ctx/nested_sched_ctxs.c

@@ -53,7 +53,10 @@ static void sched_ctx_func(void *descr[] STARPU_ATTRIBUTE_UNUSED, void *arg)
 	unsigned sched_ctx = (uintptr_t)arg;
 	int t = parallel_code(sched_ctx);
 	if (sched_ctx > 0 && sched_ctx < 3)
-		tasks_executed[sched_ctx-1] += t;
+	{
+		STARPU_ATOMIC_ADD(&tasks_executed[sched_ctx-1], t);
+	}
+
 	//printf("w %d executed %d it \n", w, n);
 }