Explorar o código

make sure it is possible to execute the task

Cédric Augonnet %!s(int64=17) %!d(string=hai) anos
pai
achega
ed75f15a88
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      examples/incrementer/incrementer_runtime.c

+ 6 - 1
examples/incrementer/incrementer_runtime.c

@@ -87,7 +87,12 @@ int main(int argc, char **argv)
 		task->buffers[0].handle = float_array_handle;
 		task->buffers[0].mode = STARPU_RW;
 
-		starpu_submit_task(task);
+		int ret = starpu_submit_task(task);
+		if (STARPU_UNLIKELY(ret == -ENODEV))
+		{
+			fprintf(stderr, "No worker may execute this task\n");
+			exit(0);
+		}
 	}
 
 	pthread_mutex_lock(&mutex);