Prechádzať zdrojové kódy

make sure it is possible to execute the task

Cédric Augonnet 16 rokov pred
rodič
commit
ed75f15a88

+ 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);