Browse Source

examples: do not print when environment variable STARPU_SSILENT is set

Nathalie Furmento 13 years ago
parent
commit
e80e9ec3b7

+ 0 - 2
examples/basic_examples/multiformat.c

@@ -20,8 +20,6 @@
 #endif
 #include "multiformat_types.h"
 
-#define FPRINTF(ofile, fmt, args ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ##args); }} while(0)
-
 static struct point array_of_structs[N_ELEMENTS];
 static starpu_data_handle_t array_of_structs_handle;
 

+ 2 - 1
examples/basic_examples/multiformat_conversion_codelets.c

@@ -13,6 +13,7 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+
 #include <starpu.h>
 #include "multiformat_types.h"
 
@@ -46,7 +47,7 @@ struct starpu_codelet cuda_to_cpu_cl = {
 #ifdef STARPU_USE_OPENCL
 void opencl_to_cpu(void *buffers[], void *arg)
 {
-	fprintf(stderr, "User Entering %s\n", __func__);
+	FPRINTF(stderr, "User Entering %s\n", __func__);
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
 	struct point *dst = STARPU_MULTIFORMAT_GET_PTR(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);

+ 1 - 0
examples/basic_examples/multiformat_conversion_codelets_cuda.cu

@@ -13,6 +13,7 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+
 #include <starpu.h>
 #include <starpu_cuda.h>
 #include "multiformat_types.h"

+ 1 - 0
examples/basic_examples/multiformat_conversion_codelets_opencl.c

@@ -13,6 +13,7 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+
 #include <starpu.h>
 #include <starpu_opencl.h>
 

+ 2 - 0
examples/basic_examples/multiformat_conversion_codelets_opencl_kernel.cl

@@ -13,7 +13,9 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+
 #include "multiformat_types.h"
+
 __kernel void cpu_to_opencl_opencl(__global struct point *src,
 				   __global struct struct_of_arrays *dst,
 				   unsigned int n)

+ 3 - 1
examples/basic_examples/multiformat_cuda.cu

@@ -13,9 +13,11 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+
 #include <starpu.h>
 #include <starpu_cuda.h>
 #include "multiformat_types.h"
+
 static __global__ void multiformat_cuda(struct struct_of_arrays *soa, unsigned n)
 {
         unsigned i =  blockIdx.x*blockDim.x + threadIdx.x;
@@ -28,7 +30,7 @@ extern "C" void multiformat_scal_cuda_func(void *buffers[], void *_args)
 {
 	(void) _args;
 
-	fprintf(stderr, "Running the cuda kernel (%s)\n", __func__);
+	FPRINTF(stderr, "Running the cuda kernel (%s)\n", __func__);
 	unsigned int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	struct struct_of_arrays *soa;
 

+ 1 - 0
examples/basic_examples/multiformat_opencl.c

@@ -13,6 +13,7 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+
 #include <starpu.h>
 #include <starpu_opencl.h>
 

+ 1 - 0
examples/basic_examples/multiformat_opencl_kernel.cl

@@ -15,6 +15,7 @@
  */
 
 #include "multiformat_types.h"
+
 __kernel void multiformat_opencl(__global struct struct_of_arrays *soa, int nx)
 {
         const int i = get_global_id(0);

+ 1 - 0
examples/basic_examples/multiformat_types.h

@@ -26,5 +26,6 @@ struct point {
 	float x, y;
 };
 
+#define FPRINTF(ofile, fmt, args ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ##args); }} while(0)
 
 #endif