瀏覽代碼

tests/sched_ctx/sched_ctx_policy_data.c: skip test when no CPU worker available

Nathalie Furmento 8 年之前
父節點
當前提交
1eb9244dfe
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      tests/sched_ctx/sched_ctx_policy_data.c

+ 7 - 1
tests/sched_ctx/sched_ctx_policy_data.c

@@ -33,7 +33,13 @@ int main(int argc, char **argv)
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	nprocs = starpu_worker_get_count();
+	nprocs = starpu_cpu_worker_get_count();
+	if (nprocs == 0)
+	{
+		starpu_shutdown();
+		return STARPU_TEST_SKIPPED;
+	}
+
 	procs = (int*)malloc(nprocs*sizeof(int));
 	starpu_worker_get_ids_by_type(STARPU_ANY_WORKER, procs, nprocs);