Browse Source

Use a STARPU_MAXGORDONDEVS constant.

This avoids using max_gordondevs variable in parse_model_file() and is more consistent with the rest of the code.
Cyril Roelandt 13 years ago
parent
commit
764ced63f7
3 changed files with 4 additions and 3 deletions
  1. 1 0
      configure.ac
  2. 1 0
      include/starpu_config.h.in
  3. 2 3
      src/core/perfmodel/perfmodel_history.c

+ 1 - 0
configure.ac

@@ -793,6 +793,7 @@ if test x$enable_gordon = xyes -o x$enable_gordon = xmaybe; then
 
 	# now we enable Gordon if and only if a proper setup is available
 	enable_gordon=$have_valid_gordon
+	AC_DEFINE(STARPU_MAXGORDONDEVS, [1], [maximum number of GORDON devices])
 fi
 
 AC_MSG_CHECKING(whether GORDON should be used)

+ 1 - 0
include/starpu_config.h.in

@@ -68,6 +68,7 @@
 #undef STARPU_MAXCPUS
 #undef STARPU_MAXCUDADEVS
 #undef STARPU_MAXOPENCLDEVS
+#undef STARPU_MAXGORDONDEVS
 #undef STARPU_NMAXWORKERS
 #undef STARPU_MAXIMPLEMENTATIONS
 

+ 2 - 3
src/core/perfmodel/perfmodel_history.c

@@ -283,7 +283,6 @@ static void parse_model_file(FILE *f, struct starpu_perfmodel *model, unsigned s
 {
 	unsigned ret;
 	unsigned archmin = 0;
-	unsigned max_gordondevs = 1; /* XXX : we need a STARPU_MAXGORDONDEVS cst */
 	unsigned narchs;
 
 	/* We could probably write a clean loop here, but the code would not
@@ -343,8 +342,8 @@ static void parse_model_file(FILE *f, struct starpu_perfmodel *model, unsigned s
 	{
 		parse_arch(f, model, scan_history,
 			   archmin,
-			   archmin + max_gordondevs,
-			   narchs > max_gordondevs ? narchs - max_gordondevs : 0);
+			   archmin + STARPU_MAXGORDONDEVS,
+			   narchs > STARPU_MAXGORDONDEVS ? narchs - STARPU_MAXGORDONDEVS : 0);
 	}
 }