Просмотр исходного кода

use __starpu_func__ instead of __func__ which is not available on windows

Nathalie Furmento лет назад: 12
Родитель
Сommit
f1f6719353

+ 1 - 1
examples/basic_examples/multiformat_conversion_codelets.c

@@ -50,7 +50,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", __starpu_func__);
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_OPENCL_PTR(buffers[0]);
 	struct point *dst = STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);

+ 1 - 1
examples/basic_examples/multiformat_cuda.cu

@@ -29,7 +29,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", __starpu_func__);
 	unsigned int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);
 	struct struct_of_arrays *soa;
 

+ 3 - 3
include/starpu_util.h

@@ -73,16 +73,16 @@ extern "C"
 #else
 #  if defined(__CUDACC__) && defined(STARPU_HAVE_WINDOWS)
 #    define STARPU_ASSERT(x)		do { if (STARPU_UNLIKELY(!(x))) *(int*)NULL = 0; } while(0)
-#    define STARPU_ASSERT_MSG(x, msg, ...)	do { if (STARPU_UNLIKELY(!(x))) { fprintf(stderr, "[starpu][%s][assert failure] " msg "\n", __func__, ## __VA_ARGS__); *(int*)NULL = 0; }} while(0)
+#    define STARPU_ASSERT_MSG(x, msg, ...)	do { if (STARPU_UNLIKELY(!(x))) { fprintf(stderr, "[starpu][%s][assert failure] " msg "\n", __starpu_func__, ## __VA_ARGS__); *(int*)NULL = 0; }} while(0)
 #  else
 #    define STARPU_ASSERT(x)		assert(x)
-#    define STARPU_ASSERT_MSG(x, msg, ...)	do { if (STARPU_UNLIKELY(!(x))) { fprintf(stderr, "[starpu][%s][assert failure] " msg "\n", __func__, ## __VA_ARGS__); } ; assert(x); } while(0)
+#    define STARPU_ASSERT_MSG(x, msg, ...)	do { if (STARPU_UNLIKELY(!(x))) { fprintf(stderr, "[starpu][%s][assert failure] " msg "\n", __starpu_func__, ## __VA_ARGS__); } ; assert(x); } while(0)
 
 #  endif
 #endif
 
 #define STARPU_ABORT() do {                                          \
-	fprintf(stderr, "[starpu][abort] %s:%d %s\n", __FILE__, __LINE__, __func__); \
+	fprintf(stderr, "[starpu][abort] %s:%d %s\n", __FILE__, __LINE__, __starpu_func__); \
 	abort();                                                     \
 } while(0)
 

+ 4 - 4
mpi/src/starpu_mpi_private.h

@@ -41,7 +41,7 @@ void _starpu_mpi_set_debug_level(int level);
 		if (!getenv("STARPU_SILENT") && level <= _debug_level)	\
 		{							\
 			if (_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_debug_rank); \
-			fprintf(stderr, "%*s[%d][starpu_mpi][%s] " fmt , (_debug_rank+1)*4, "", _debug_rank, __func__ ,##args); \
+			fprintf(stderr, "%*s[%d][starpu_mpi][%s] " fmt , (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ ,##args); \
 			fflush(stderr); \
 		}			\
 	} while(0);
@@ -51,17 +51,17 @@ void _starpu_mpi_set_debug_level(int level);
 
 #define _STARPU_MPI_DISP(fmt, args ...) do { if (!getenv("STARPU_SILENT")) { \
 	       				     if (_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_debug_rank); \
-                                             fprintf(stderr, "%*s[%d][starpu_mpi][%s] " fmt , (_debug_rank+1)*4, "", _debug_rank, __func__ ,##args); \
+                                             fprintf(stderr, "%*s[%d][starpu_mpi][%s] " fmt , (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ ,##args); \
                                              fflush(stderr); }} while(0);
 
 #ifdef STARPU_VERBOSE0
 #  define _STARPU_MPI_LOG_IN()             do { if (!getenv("STARPU_SILENT")) { \
                                                if (_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_debug_rank);                        \
-                                               fprintf(stderr, "%*s[%d][starpu_mpi][%s] -->\n", (_debug_rank+1)*4, "", _debug_rank, __func__ ); \
+                                               fprintf(stderr, "%*s[%d][starpu_mpi][%s] -->\n", (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ ); \
                                                fflush(stderr); }} while(0)
 #  define _STARPU_MPI_LOG_OUT()            do { if (!getenv("STARPU_SILENT")) { \
                                                if (_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_debug_rank);                        \
-                                               fprintf(stderr, "%*s[%d][starpu_mpi][%s] <--\n", (_debug_rank+1)*4, "", _debug_rank, __func__ ); \
+                                               fprintf(stderr, "%*s[%d][starpu_mpi][%s] <--\n", (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ ); \
                                                fflush(stderr); }} while(0)
 #else
 #  define _STARPU_MPI_LOG_IN()

+ 2 - 2
mpi/tests/helper.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -21,6 +21,6 @@
 #define FPRINTF(ofile, fmt, args ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ##args); }} while(0)
 #define FPRINTF_MPI(fmt, args ...) do { if (!getenv("STARPU_SILENT")) { \
     						int _disp_rank; MPI_Comm_rank(MPI_COMM_WORLD, &_disp_rank);       \
-                                                fprintf(stderr, "[%d][starpu_mpi][%s] " fmt , _disp_rank, __func__ ,##args); \
+                                                fprintf(stderr, "[%d][starpu_mpi][%s] " fmt , _disp_rank, __starpu_func__ ,##args); \
                                                 fflush(stderr); }} while(0);
 

+ 2 - 2
mpi/tests/mpi_reduction_kernels.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -19,7 +19,7 @@
 
 #define _DISPLAY(fmt, args ...) do { \
 		int _display_rank; MPI_Comm_rank(MPI_COMM_WORLD, &_display_rank);	\
-		fprintf(stderr, "[%d][%s] " fmt , _display_rank, __func__ ,##args); 	\
+		fprintf(stderr, "[%d][%s] " fmt , _display_rank, __starpu_func__ ,##args); 	\
 		fflush(stderr); } while(0)
 
 /*

+ 2 - 2
socl/src/debug.h

@@ -22,7 +22,7 @@
 #ifdef STARPU_VERBOSE
 #define DEBUG
 #include <stdio.h>
-  #define DEBUG_MSG(...) do { if (!getenv("STARPU_SILENT")) { fprintf(stderr, "[SOCL] [%s] ", __func__); fprintf(stderr, __VA_ARGS__);}} while (0);
+  #define DEBUG_MSG(...) do { if (!getenv("STARPU_SILENT")) { fprintf(stderr, "[SOCL] [%s] ", __starpu_func__); fprintf(stderr, __VA_ARGS__);}} while (0);
   #define DEBUG_MSG_NOHEAD(...) do { if (!getenv("STARPU_SILENT")) { fprintf(stderr, __VA_ARGS__);}} while (0);
   #define DEBUG_ERROR(...) do { if (!getenv("STARPU_SILENT")) { fprintf(stderr, "[SOCL] ERROR: "__VA_ARGS__); } exit(1); } while (0);
 #else
@@ -32,7 +32,7 @@
 #endif
 
 
-#define ERROR_MSG(...) do { fprintf(stderr, "[SOCL] [%s] ERROR: ", __func__); fprintf(stderr, __VA_ARGS__); } while (0);
+#define ERROR_MSG(...) do { fprintf(stderr, "[SOCL] [%s] ERROR: ", __starpu_func__); fprintf(stderr, __VA_ARGS__); } while (0);
 #define ERROR_MSG_NOHEAD(...) fprintf(stderr, __VA_ARGS__)
 #define ERROR_STOP(...) do { ERROR_MSG(__VA_ARGS__); exit(1); } while(0);
 

+ 2 - 2
socl/src/gc.h

@@ -27,7 +27,7 @@ void gc_entity_init(void *arg, void (*release_callback)(void*), char*name);
 void * gc_entity_alloc(unsigned int size, void (*release_callback)(void*), char * name);
 
 void gc_entity_retain_ex(void *arg, const char *);
-#define gc_entity_retain(arg) gc_entity_retain_ex(arg, __func__)
+#define gc_entity_retain(arg) gc_entity_retain_ex(arg, __starpu_func__)
 
 /** Decrement reference counter and release entity if applicable */
 int gc_entity_release_ex(entity e, const char*);
@@ -35,7 +35,7 @@ int gc_entity_release_ex(entity e, const char*);
 int gc_active_entity_count(void);
 void gc_print_remaining_entities(void);
 
-#define gc_entity_release(a) gc_entity_release_ex(&(a)->_entity, __func__)
+#define gc_entity_release(a) gc_entity_release_ex(&(a)->_entity, __starpu_func__)
 
 #define gc_entity_store(dest,e) \
   do {\

+ 2 - 2
src/common/starpu_spinlock.h

@@ -48,7 +48,7 @@ int _starpu_spin_lock(struct _starpu_spinlock *lock);
 #if defined(STARPU_SPINLOCK_CHECK)
 #define _starpu_spin_lock(lock) ({ \
 	_starpu_spin_lock(lock); \
-	(lock)->last_taker = __func__; \
+	(lock)->last_taker = __starpu_func__; \
 	0; \
 })
 #endif
@@ -57,7 +57,7 @@ int _starpu_spin_trylock(struct _starpu_spinlock *lock);
 #define _starpu_spin_trylock(lock) ({ \
 	int err = _starpu_spin_trylock(lock); \
 	if (!err) \
-		(lock)->last_taker = __func__; \
+		(lock)->last_taker = __starpu_func__; \
 	err; \
 })
 #endif

+ 6 - 6
src/common/utils.h

@@ -75,25 +75,25 @@
 			struct _starpu_spinlock *, lock)
 
 #ifdef STARPU_VERBOSE
-#  define _STARPU_DEBUG(fmt, args ...) do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%s] " fmt ,__func__ ,##args); fflush(stderr); }} while(0)
+#  define _STARPU_DEBUG(fmt, args ...) do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%s] " fmt ,__starpu_func__ ,##args); fflush(stderr); }} while(0)
 #else
 #  define _STARPU_DEBUG(fmt, args ...) do { } while (0)
 #endif
 
 #ifdef STARPU_VERBOSE0
-#  define _STARPU_LOG_IN()             do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%ld][%s] -->\n", pthread_self(), __func__ ); }} while(0)
-#  define _STARPU_LOG_OUT()            do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%ld][%s] <--\n", pthread_self(), __func__ ); }} while(0)
-#  define _STARPU_LOG_OUT_TAG(outtag)  do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%ld][%s] <-- (%s)\n", pthread_self(), __func__, outtag); }} while(0)
+#  define _STARPU_LOG_IN()             do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%ld][%s] -->\n", pthread_self(), __starpu_func__ ); }} while(0)
+#  define _STARPU_LOG_OUT()            do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%ld][%s] <--\n", pthread_self(), __starpu_func__ ); }} while(0)
+#  define _STARPU_LOG_OUT_TAG(outtag)  do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%ld][%s] <-- (%s)\n", pthread_self(), __starpu_func__, outtag); }} while(0)
 #else
 #  define _STARPU_LOG_IN()
 #  define _STARPU_LOG_OUT()
 #  define _STARPU_LOG_OUT_TAG(outtag)
 #endif
 
-#define _STARPU_DISP(fmt, args ...) do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%s] " fmt ,__func__ ,##args); }} while(0)
+#define _STARPU_DISP(fmt, args ...) do { if (!getenv("STARPU_SILENT")) {fprintf(stderr, "[starpu][%s] " fmt ,__starpu_func__ ,##args); }} while(0)
 #define _STARPU_ERROR(fmt, args ...)                                                  \
 	do {                                                                          \
-                fprintf(stderr, "\n\n[starpu][%s] Error: " fmt ,__func__ ,##args);    \
+                fprintf(stderr, "\n\n[starpu][%s] Error: " fmt ,__starpu_func__ ,##args);    \
 		fprintf(stderr, "\n\n");					      \
 		STARPU_ABORT();                                                       \
 	} while (0)

+ 2 - 2
tests/datawizard/interfaces/multiformat/advanced/multiformat_data_release.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012  INRIA
- * Copyright (C) 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -23,7 +23,7 @@
 static int vector[NX];
 static starpu_data_handle_t handle;
 
-#define ENTER() do { FPRINTF(stderr, "Entering %s\n", __func__); } while (0)
+#define ENTER() do { FPRINTF(stderr, "Entering %s\n", __starpu_func__); } while (0)
 
 extern struct stats global_stats;
 

+ 2 - 2
tests/datawizard/interfaces/multiformat/advanced/multiformat_handle_conversion.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012  INRIA
- * Copyright (C) 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -24,7 +24,7 @@
 
 #if DEBUG
 #define SYNCHRONOUS 1 /* Easier to debug with synchronous tasks */
-#define ENTER() do { FPRINTF(stderr, "Entering %s\n", __func__); } while (0)
+#define ENTER() do { FPRINTF(stderr, "Entering %s\n", __starpu_func__); } while (0)
 #else
 #define SYNCHRONOUS 0
 #define ENTER()

+ 1 - 1
tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets.c

@@ -23,7 +23,7 @@ void cuda_to_cpu(void *buffers[], void *arg)
 {
 	STARPU_SKIP_IF_VALGRIND;
 
-	FPRINTF(stderr, "Entering %s\n", __func__);
+	FPRINTF(stderr, "Entering %s\n", __starpu_func__);
 	struct struct_of_arrays *src = STARPU_MULTIFORMAT_GET_CUDA_PTR(buffers[0]);
 	struct point *dst = STARPU_MULTIFORMAT_GET_CPU_PTR(buffers[0]);
 	int n = STARPU_MULTIFORMAT_GET_NX(buffers[0]);

+ 1 - 1
tests/datawizard/interfaces/multiformat/multiformat_conversion_codelets_cuda.cu

@@ -32,7 +32,7 @@ static __global__ void cpu_to_cuda_cuda(struct point *src,
 
 extern "C" void cpu_to_cuda_cuda_func(void *buffers[], void *_args)
 {
-	FPRINTF(stderr, "Entering %s\n", __func__);
+	FPRINTF(stderr, "Entering %s\n", __starpu_func__);
 	struct point *src;
 	struct struct_of_arrays *dst;
 

+ 1 - 1
tests/datawizard/interfaces/multiformat/multiformat_cuda.cu

@@ -41,7 +41,7 @@ static __global__ void multiformat_cuda(struct struct_of_arrays *soa, unsigned n
 
 extern "C" void test_multiformat_cuda_func(void *buffers[], void *args)
 {
-	FPRINTF(stderr, "Entering %s\n", __func__);
+	FPRINTF(stderr, "Entering %s\n", __starpu_func__);
 	int factor;
 	int *ret;
 	cudaError_t error;

+ 6 - 6
tests/datawizard/interfaces/test_interfaces.c

@@ -396,7 +396,7 @@ ram_to_cuda(void)
 	if (err != 0)
 		return TASK_SUBMISSION_FAILURE;
 
-	FPRINTF(stderr, "[%s] : %d\n", __func__, current_config->copy_failed);
+	FPRINTF(stderr, "[%s] : %d\n", __starpu_func__, current_config->copy_failed);
 	return current_config->copy_failed;
 }
 
@@ -415,7 +415,7 @@ cuda_to_cuda(void)
 	if (err != 0)
 		return TASK_SUBMISSION_FAILURE;
 
-	FPRINTF(stderr, "[%s] : %d\n", __func__, current_config->copy_failed);
+	FPRINTF(stderr, "[%s] : %d\n", __starpu_func__, current_config->copy_failed);
 	return current_config->copy_failed;
 }
 #endif
@@ -434,7 +434,7 @@ cuda_to_ram(void)
 	if (err != 0)
 		return TASK_SUBMISSION_FAILURE;
 
-	FPRINTF(stderr, "[%s] : %d\n", __func__, current_config->copy_failed);
+	FPRINTF(stderr, "[%s] : %d\n", __starpu_func__, current_config->copy_failed);
 	return current_config->copy_failed;
 }
 #endif /* !STARPU_USE_CUDA */
@@ -454,7 +454,7 @@ ram_to_opencl(void)
 	if (err != 0)
 		return TASK_SUBMISSION_FAILURE;
 
-	FPRINTF(stderr, "[%s] : %d\n", __func__, current_config->copy_failed);
+	FPRINTF(stderr, "[%s] : %d\n", __starpu_func__, current_config->copy_failed);
 	return current_config->copy_failed;
 }
 
@@ -472,7 +472,7 @@ opencl_to_ram(void)
 	if (err != 0)
 		return TASK_SUBMISSION_FAILURE;
 
-	FPRINTF(stderr, "[%s] : %d\n", __func__, current_config->copy_failed);
+	FPRINTF(stderr, "[%s] : %d\n", __starpu_func__, current_config->copy_failed);
 	return current_config->copy_failed;
 }
 #endif /* !STARPU_USE_OPENCL */
@@ -569,7 +569,7 @@ ram_to_ram(void)
 		goto out;
 	}
 
-	FPRINTF(stderr, "[%s] : %d\n", __func__, current_config->copy_failed);
+	FPRINTF(stderr, "[%s] : %d\n", __starpu_func__, current_config->copy_failed);
 	err = current_config->copy_failed;
 
 out: