Quellcode durchsuchen

use dynamic code loading mechanisms instead of some broken hard-coded stuff.

Cédric Augonnet vor 16 Jahren
Ursprung
Commit
a51fd80a69
2 geänderte Dateien mit 20 neuen und 6 gelöschten Zeilen
  1. 10 3
      examples/tag_example/tag_example2.c
  2. 10 3
      examples/tag_example/tag_example3.c

+ 10 - 3
examples/tag_example/tag_example2.c

@@ -23,6 +23,10 @@
 
 #include <starpu.h>
 
+#ifdef USE_GORDON
+#include <gordon/null.h>
+#endif
+
 #define TAG(i, iter)	((starpu_tag_t)  (((uint64_t)iter)<<32 | (i)) )
 
 sem_t sem;
@@ -106,14 +110,17 @@ int main(int argc __attribute__((unused)) , char **argv __attribute__((unused)))
 
 	starpu_init(NULL);
 
+#ifdef USE_GORDON
+	/* load an empty kernel and get its identifier */
+	unsigned gordon_null_kernel = load_gordon_null_kernel();
+#endif
+
 	parse_args(argc, argv);
 
 	cl.core_func = core_codelet;
 	cl.cublas_func = core_codelet;
 #ifdef USE_GORDON
-#ifdef SPU_FUNC_NULL
-	cl.gordon_func = SPU_FUNC_NULL;
-#endif
+	cl.gordon_func = gordon_null_kernel;
 #endif
 	cl.where = ANY;
 	cl.nbuffers = 0;

+ 10 - 3
examples/tag_example/tag_example3.c

@@ -23,6 +23,10 @@
 
 #include <starpu.h>
 
+#ifdef USE_GORDON
+#include <gordon/null.h>
+#endif
+
 #define TAG(i, iter)	((starpu_tag_t)  (((uint64_t)iter)<<32 | (i)) )
 
 sem_t sem;
@@ -106,14 +110,17 @@ int main(int argc __attribute__((unused)) , char **argv __attribute__((unused)))
 
 	starpu_init(NULL);
 
+#ifdef USE_GORDON
+	/* load an empty kernel and get its identifier */
+	unsigned gordon_null_kernel = load_gordon_null_kernel();
+#endif
+
 	parse_args(argc, argv);
 
 	cl.core_func = core_codelet;
 	cl.cublas_func = core_codelet;
 #ifdef USE_GORDON
-#ifdef SPU_FUNC_NULL
-	cl.gordon_func = SPU_FUNC_NULL;
-#endif
+	cl.gordon_func = gordon_null_kernel;
 #endif
 	cl.where = ANY;
 	cl.nbuffers = 0;