Browse Source

examples/basic_examples/multiformat: no longer define FPRINTF in multiformat_types.h as it is included in an opencl kernel and variadic macros are not allowed in OpenCL

Nathalie Furmento 12 years ago
parent
commit
a7614b7809

+ 2 - 0
examples/basic_examples/multiformat.c

@@ -25,6 +25,8 @@ static int ncuda = 0;
 static int nopencl = 0;
 #endif
 
+#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
+
 static struct point array_of_structs[N_ELEMENTS];
 static starpu_data_handle_t array_of_structs_handle;
 

+ 2 - 0
examples/basic_examples/multiformat_conversion_codelets.c

@@ -17,6 +17,8 @@
 #include <starpu.h>
 #include "multiformat_types.h"
 
+#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
+
 #ifdef STARPU_USE_CUDA
 void cuda_to_cpu(void *buffers[], void *arg)
 {

+ 2 - 0
examples/basic_examples/multiformat_cuda.cu

@@ -17,6 +17,8 @@
 #include <starpu.h>
 #include "multiformat_types.h"
 
+#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
+
 static __global__ void multiformat_cuda(struct struct_of_arrays *soa, unsigned n)
 {
         unsigned i =  blockIdx.x*blockDim.x + threadIdx.x;

+ 1 - 2
examples/basic_examples/multiformat_types.h

@@ -13,6 +13,7 @@
  *
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
+
 #ifndef MULTIFORMAT_TYPES_H
 #define MULTIFORMAT_TYPES_H
 
@@ -28,6 +29,4 @@ struct point
 	float x, y;
 };
 
-#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
-
 #endif