Sfoglia il codice sorgente

Make STARPU_WORKERS_CUDAID and STARPU_WORKERS_OPENCLID take precedence over the configuration passed to starpu_init()

Cyril Roelandt 13 anni fa
parent
commit
38a5ddb988
1 ha cambiato i file con 8 aggiunte e 8 eliminazioni
  1. 8 8
      src/core/topology.c

+ 8 - 8
src/core/topology.c

@@ -145,14 +145,7 @@ static void _starpu_initialize_workers_gpuid(int use_explicit_workers_gpuid, int
 	 * cpus. */
 
 	/* what do we use, explicit value, env. variable, or round-robin ? */
-	if (use_explicit_workers_gpuid)
-	{
-		/* we use the explicit value from the user */
-		memcpy(workers_gpuid,
-                       explicit_workers_gpuid,
-                       STARPU_NMAXWORKERS*sizeof(unsigned));
-	}
-	else if ((strval = getenv(varname)))
+	if ((strval = getenv(varname)))
 	{
 		/* STARPU_WORKERS_CUDAID certainly contains less entries than
 		 * STARPU_NMAXWORKERS, so we reuse its entries in a round robin
@@ -191,6 +184,13 @@ static void _starpu_initialize_workers_gpuid(int use_explicit_workers_gpuid, int
 			}
 		}
 	}
+	else if (use_explicit_workers_gpuid)
+	{
+		/* we use the explicit value from the user */
+		memcpy(workers_gpuid,
+                       explicit_workers_gpuid,
+                       STARPU_NMAXWORKERS*sizeof(unsigned));
+	}
 	else
 	{
 		/* by default, we take a round robin policy */