|
@@ -44,16 +44,21 @@ int main(void)
|
|
int *procs2 = NULL;
|
|
int *procs2 = NULL;
|
|
int i;
|
|
int i;
|
|
int n = 20;
|
|
int n = 20;
|
|
|
|
+
|
|
int ret = starpu_init(NULL);
|
|
int ret = starpu_init(NULL);
|
|
if (ret == -ENODEV)
|
|
if (ret == -ENODEV)
|
|
return 77;
|
|
return 77;
|
|
STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
|
|
STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
|
|
- ncpu = starpu_cpu_worker_get_count();
|
|
|
|
|
|
|
|
|
|
+ ncpu = starpu_cpu_worker_get_count();
|
|
/* actually we really need at least 2 CPU workers such to allocate 2
|
|
/* actually we really need at least 2 CPU workers such to allocate 2
|
|
* non overlapping contexts */
|
|
* non overlapping contexts */
|
|
if (ncpu < 2)
|
|
if (ncpu < 2)
|
|
|
|
+ {
|
|
|
|
+ starpu_shutdown();
|
|
return 77;
|
|
return 77;
|
|
|
|
+ }
|
|
|
|
+
|
|
procs = calloc(ncpu, sizeof(int));
|
|
procs = calloc(ncpu, sizeof(int));
|
|
starpu_worker_get_ids_by_type(STARPU_CPU_WORKER, procs, ncpu);
|
|
starpu_worker_get_ids_by_type(STARPU_CPU_WORKER, procs, ncpu);
|
|
|
|
|