瀏覽代碼

Avoid duplicate FPRINTF definition

Samuel Thibault 4 年之前
父節點
當前提交
dce410881d
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 3 3
      examples/interface/complex.c
  2. 3 3
      examples/interface/complex_codelet.h

+ 3 - 3
examples/interface/complex.c

@@ -150,7 +150,7 @@ int main(void)
 	starpu_task_wait_for_all();
 	if (compare != 0)
 	{
-	     FPRINTF(stderr, "Complex numbers should NOT be similar\n");
+	     _FPRINTF(stderr, "Complex numbers should NOT be similar\n");
 	     goto end;
 	}
 
@@ -183,7 +183,7 @@ int main(void)
 
 	if (compare != 1)
 	{
-	     FPRINTF(stderr, "Complex numbers should be similar\n");
+	     _FPRINTF(stderr, "Complex numbers should be similar\n");
 	}
 
 	/* Put another value again */
@@ -267,7 +267,7 @@ int main(void)
 	starpu_task_wait_for_all();
 	if (compare != 1)
 	{
-	     FPRINTF(stderr, "Complex numbers should be similar\n");
+	     _FPRINTF(stderr, "Complex numbers should be similar\n");
 	     goto end;
 	}
 

+ 3 - 3
examples/interface/complex_codelet.h

@@ -20,7 +20,7 @@
 #ifndef __COMPLEX_CODELET_H
 #define __COMPLEX_CODELET_H
 
-#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
+#define _FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
 
 /* Dumb performance model for simgrid */
 static double complex_cost_function(struct starpu_task *task, unsigned nimpl)
@@ -87,10 +87,10 @@ void display_complex_codelet(void *descr[], void *_args)
 	if (_args)
 		starpu_codelet_unpack_args(_args, &msg);
 
-	FPRINTF(stderr, "[%s]\n", _args?msg:NULL);
+	_FPRINTF(stderr, "[%s]\n", _args?msg:NULL);
 	for(i=0 ; i<nx ; i++)
 	{
-		FPRINTF(stderr, "\tComplex[%d] = %3.2f + %3.2f i\n", i, real[i], imaginary[i]);
+		_FPRINTF(stderr, "\tComplex[%d] = %3.2f + %3.2f i\n", i, real[i], imaginary[i]);
 	}
 	fflush(stderr);
 }