Sfoglia il codice sorgente

examples/interface: turn example silent if environment variable STARPU_SSILENT is set

Nathalie Furmento 11 anni fa
parent
commit
dce47dbbb2
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 0 2
      examples/interface/complex.c
  2. 3 1
      examples/interface/complex_codelet.h

+ 0 - 2
examples/interface/complex.c

@@ -18,8 +18,6 @@
 #include "complex_interface.h"
 #include "complex_codelet.h"
 
-#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
-
 static int can_execute(unsigned workerid, struct starpu_task *task, unsigned nimpl)
 {
        if (starpu_worker_get_type(workerid) == STARPU_OPENCL_WORKER)

+ 3 - 1
examples/interface/complex_codelet.h

@@ -20,6 +20,8 @@
 #ifndef __COMPLEX_CODELET_H
 #define __COMPLEX_CODELET_H
 
+#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
+
 void compare_complex_codelet(void *descr[], void *_args)
 {
 	int nx1 = STARPU_COMPLEX_GET_NX(descr[0]);
@@ -70,7 +72,7 @@ void display_complex_codelet(void *descr[], void *_args)
 
 	for(i=0 ; i<nx ; i++)
 	{
-		fprintf(stderr, "[%s] Complex[%d] = %3.2f + %3.2f i\n", _args?msg:NULL, i, real[i], imaginary[i]);
+		FPRINTF(stderr, "[%s] Complex[%d] = %3.2f + %3.2f i\n", _args?msg:NULL, i, real[i], imaginary[i]);
 	}
 }