Browse Source

merge trunk@7200:7269

Nathalie Furmento 13 years ago
parent
commit
1604d3ec64
53 changed files with 553 additions and 160 deletions
  1. 1 0
      .gitignore
  2. 1 1
      AUTHORS
  3. 8 0
      ChangeLog
  4. 2 0
      Makefile.am
  5. 28 4
      configure.ac
  6. 3 2
      doc/Makefile.am
  7. 1 1
      doc/chapters/basic-api.texi
  8. 2 3
      doc/chapters/basic-examples.texi
  9. 13 7
      doc/chapters/c-extensions.texi
  10. 2 0
      doc/chapters/configuration.texi
  11. 7 0
      examples/Makefile.am
  12. 7 39
      examples/filters/custom_mf/custom_interface.c
  13. 4 1
      gcc-plugin/Makefile.am
  14. 1 5
      gcc-plugin/examples/vector_scal/vector_scal.c
  15. 117 2
      gcc-plugin/src/starpu.c
  16. 6 0
      gcc-plugin/tests/Makefile.am
  17. 5 2
      gcc-plugin/tests/base.c
  18. 9 1
      gcc-plugin/tests/mocks.h
  19. 36 0
      gcc-plugin/tests/registered-errors.c
  20. 128 0
      gcc-plugin/tests/registered.c
  21. 16 0
      gcc-plugin/tests/task-errors.c
  22. 5 5
      include/starpu.h
  23. 1 0
      include/starpu_config.h.in
  24. 4 6
      include/starpu_data_interfaces.h
  25. 1 0
      include/starpu_opencl.h
  26. 7 2
      mpi/Makefile.am
  27. 7 0
      socl/examples/Makefile.am
  28. 1 1
      src/Makefile.am
  29. 1 1
      src/common/fxt.c
  30. 2 3
      src/core/perfmodel/perfmodel_history.c
  31. 0 16
      src/core/sched_policy.c
  32. 16 0
      src/core/sched_policy.h
  33. 2 2
      src/core/topology.c
  34. 7 1
      src/core/workers.h
  35. 6 6
      src/datawizard/interfaces/block_interface.c
  36. 1 0
      src/datawizard/interfaces/data_interface.c
  37. 6 6
      src/datawizard/interfaces/matrix_interface.c
  38. 21 8
      src/datawizard/interfaces/multiformat_interface.c
  39. 6 6
      src/datawizard/interfaces/variable_interface.c
  40. 7 7
      src/datawizard/interfaces/vector_interface.c
  41. 3 3
      src/datawizard/interfaces/void_interface.c
  42. 5 1
      src/debug/traces/starpu_fxt.c
  43. 6 5
      src/dolib.c
  44. 3 2
      src/drivers/cpu/driver_cpu.c
  45. 3 2
      src/drivers/cuda/driver_cuda.c
  46. 1 1
      src/drivers/opencl/driver_opencl.c
  47. 5 2
      starpufft/Makefile.am
  48. 7 1
      tests/Makefile.am
  49. 4 2
      tests/datawizard/interfaces/test_interfaces.c
  50. 5 1
      tests/perfmodels/valid_model.c
  51. 7 0
      tools/Makefile.am
  52. 2 2
      tools/starpu_fxt_stats.c
  53. 4 0
      tools/starpu_fxt_tool.c

+ 1 - 0
.gitignore

@@ -287,3 +287,4 @@ starpu.log
 /tests/datawizard/interfaces/copy_interfaces
 /gcc-plugin/tests/release
 /gcc-plugin/tests/opencl
+/gcc-plugin/tests/registered

+ 1 - 1
AUTHORS

@@ -4,7 +4,7 @@ Jérôme Clet-Ortega <jerome.clet-ortega@labri.fr>
 Nicolas Collin <nicolas.collin@inria.fr>
 Nathalie Furmento <nathalie.furmento@labri.fr>
 Sylvain Henry <sylvain.henry@inria.fr>
-Cyril Roélandt <cyril.roelandt@inria.fr>
+Cyril Roelandt <cyril.roelandt@inria.fr>
 François Tessier <francois.tessier@inria.fr>
 Samuel Thibault <samuel.thibault@labri.fr>
 Pierre André Wacrenier <wacrenier@labri.fr>

+ 8 - 0
ChangeLog

@@ -29,6 +29,8 @@ New features:
   * New functionnality to wrapper starpu_insert_task to pass a array of
 	data_handles via the parameter STARPU_DATA_ARRAY
   * Enable GPU-GPU direct transfers.
+  * GCC plug-in
+	- Add `registered' attribute
 
 Changes:
   * The FxT code can now be used on systems other than Linux.
@@ -267,3 +269,9 @@ Changes:
    - transparent data coherency management
    - High-level expressive interface
 
+
+# Local Variables:
+# mode: text
+# coding: utf-8
+# ispell-local-dictionary: "american"
+# End:

+ 2 - 0
Makefile.am

@@ -28,7 +28,9 @@ if BUILD_SOCL
 SUBDIRS += socl
 endif
 
+if BUILD_EXAMPLES
 SUBDIRS += examples
+endif
 
 if BUILD_GCC_PLUGIN
 SUBDIRS += gcc-plugin

+ 28 - 4
configure.ac

@@ -823,6 +823,7 @@ if test x$enable_gordon = xyes -o x$enable_gordon = xmaybe; then
 
 	# now we enable Gordon if and only if a proper setup is available
 	enable_gordon=$have_valid_gordon
+	AC_DEFINE(STARPU_MAXGORDONDEVS, [1], [maximum number of GORDON devices])
 fi
 
 AC_MSG_CHECKING(whether GORDON should be used)
@@ -861,7 +862,7 @@ if test x$enable_debug = xyes; then
 	CFLAGS="$CFLAGS -O0"
 	AC_DEFINE(STARPU_SPINLOCK_CHECK, [1], [check spinlock use])
 else
-	CFLAGS="$CFLAGS -O3"
+	CFLAGS="-O3 $CFLAGS"
 fi
 CFLAGS+=" -gdwarf-2 -g3 "
 
@@ -1199,13 +1200,13 @@ fi
 AC_ARG_ENABLE([starpu-top],
   [AS_HELP_STRING([--disable-starpu-top],
     [build StarPU-Top])],
-  [enable_starpu_top="no"],
+  [enable_starpu_top="$enableval"],
   [enable_starpu_top="maybe"])
 
 # Check whether StarPU-Top can be built
 AC_MSG_CHECKING(for StarPU-Top)
 
-if test "x$enable_starpu_top" = "xmaybe" ; then
+if test "x$enable_starpu_top" != "xno" ; then
 	can_build_starpu_top=no
 	AC_PATH_PROGS([QMAKE], [qmake-qt4 qmake], [not-found])
 	if test x$QMAKE != xnot-found; then
@@ -1247,7 +1248,7 @@ if test "x$enable_starpu_top" = "xmaybe" ; then
 	fi
 fi
 
-if test "x$enable_starpu_top" = "xmaybe" ; then
+if test "x$enable_starpu_top" != "xno" ; then
   build_starpu_top=$can_build_starpu_top
 else
   build_starpu_top=no
@@ -1428,6 +1429,11 @@ fi
 #                                                                             #
 ###############################################################################
 
+AC_ARG_ENABLE(build-examples, [AS_HELP_STRING([--enable-build-examples],
+			[enable building of examples])],
+			enable_build_examples=$enableval, enable_build_examples=no)
+# check stuff for examples (todo)
+AM_CONDITIONAL(BUILD_EXAMPLES, [test x$enable_build_examples != xno])
 AC_ARG_ENABLE(opengl-render, [AS_HELP_STRING([--enable-opengl-render],
 			[enable OpenGL rendering of some examples])],
 			enable_opengl_render=$enableval, enable_opengl_render=no)
@@ -1551,6 +1557,12 @@ if test x$blas_lib = xmaybe; then
      if test x$use_system_blas = xyes; then
         AC_DEFINE(STARPU_SYSTEM_BLAS, [1], [use refblas library])
 	blas_lib=system
+     elif test x"$BLAS_LIBS" != x; then
+        AC_DEFINE(STARPU_SYSTEM_BLAS, [1], [use user defined library])
+        STARPU_BLAS_LDFLAGS="$BLAS_LIBS"
+        AC_SUBST(STARPU_BLAS_LDFLAGS)
+        blas_lib=system
+        AC_ARG_VAR([BLAS_LIBS], [linker flags for blas])
      else
 	blas_lib=none
      fi
@@ -1707,6 +1719,18 @@ AC_CHECK_MEMBER([struct cudaDeviceProp.pciBusID],
   AC_DEFINE([STARPU_HAVE_BUSID],[1],[Define to 1 if CUDA device properties include BusID]),
   , [[#include <cuda_runtime_api.h>]])
 
+dnl Set this condition when Automake 1.11 or later is being used.
+dnl Automake 1.11 introduced `silent-rules', hence the check.
+m4_ifdef([AM_SILENT_RULES],
+  AM_CONDITIONAL([STARPU_HAVE_AM111], [true]),
+  AM_CONDITIONAL([STARPU_HAVE_AM111], [false]))
+
+###############################################################################
+#                                                                             #
+#                                Final settings                               #
+#                                                                             #
+###############################################################################
+
 # File configuration
 AC_CONFIG_COMMANDS([executable-scripts], [
   chmod +x tests/regression/regression.sh

+ 3 - 2
doc/Makefile.am

@@ -39,8 +39,9 @@ starpu_TEXINFOS = chapters/advanced-api.texi \
 
 MAINTAINERCLEANFILES = starpu.pdf
 
-EXTRA_DIST = starpu.pdf \
-	starpu.css
+EXTRA_DIST = starpu.css
+
+dist_pdf_DATA = starpu.pdf
 
 AM_MAKEINFOHTMLFLAGS = --css-include=$(top_srcdir)/doc/starpu.css --no-headers --no-split
 

+ 1 - 1
doc/chapters/basic-api.texi

@@ -2546,7 +2546,7 @@ collect statistics about the kernel execution (used cycles, consumed power).
 @node OpenCL utilities
 @subsection OpenCL utilities
 
-@deftypefun {const char *}starpu_opencl_error_string (cl_int @var{status})
+@deftypefun {const char *} starpu_opencl_error_string (cl_int @var{status})
 Return the error message in English corresponding to @var{status}, an
 OpenCL error code.
 @end deftypefun

+ 2 - 3
doc/chapters/basic-examples.texi

@@ -358,9 +358,8 @@ main (void)
 #define FACTOR 3.14
 
   @{
-    float vector[NX] __attribute__ ((heap_allocated));
-
-#pragma starpu register vector
+    float vector[NX]
+       __attribute__ ((heap_allocated, registered));
 
     size_t i;
     for (i = 0; i < NX; i++)

+ 13 - 7
doc/chapters/c-extensions.texi

@@ -295,6 +295,7 @@ The following pragmas are provided:
 @item #pragma starpu register @var{ptr} [@var{size}]
 Register @var{ptr} as a @var{size}-element buffer.  When @var{ptr} has
 an array type whose size is known, @var{size} may be omitted.
+Alternatively, the @code{registered} attribute can be used (see below.)
 
 @item #pragma starpu unregister @var{ptr}
 Unregister the previously-registered memory area pointed to by
@@ -311,11 +312,19 @@ making it available to the tasks.
 
 @end table
 
-Additionally, the @code{heap_allocated} variable attribute offers a
-simple way to allocate storage for arrays on the heap:
+Additionally, the following attributes offer a simple way to allocate
+and register storage for arrays:
 
 @table @code
 
+@item registered
+@cindex @code{registered} attribute
+This attributes applies to local variables with an array type.  Its
+effect is to automatically register the array's storage, as per
+@code{#pragma starpu register}.  The array is automatically unregistered
+when the variable's scope is left.  This attribute is typically used in
+conjunction with the @code{heap_allocated} attribute, described below.
+
 @item heap_allocated
 @cindex @code{heap_allocated} attribute
 This attributes applies to local variables with an array type.  Its
@@ -351,16 +360,13 @@ main (int argc, char *argv[])
 
   @{
     float matrix[nblocks][nblocks][size]
-      __attribute__ ((heap_allocated));
-
-#pragma starpu register matrix
+      __attribute__ ((heap_allocated, registered));
 
     cholesky (nblocks, size, matrix);
 
 #pragma starpu wait
-#pragma starpu unregister matrix
 
-  @}   /* MATRIX is automatically freed here.  */
+  @}   /* MATRIX is automatically unregistered & freed here.  */
 
 #pragma starpu shutdown
 

+ 2 - 0
doc/chapters/configuration.texi

@@ -235,6 +235,8 @@ MKL website} provides a script to determine the linking flags.
 Enables the Scheduling Context Hypervisor plugin(@pxref{Scheduling Context Hypervisor}). 
 By default, it is disabled.
 
+@item --disable-build-examples
+Disable the build of examples.
 @end table
 
 @node Execution configuration through environment variables

+ 7 - 0
examples/Makefile.am

@@ -168,9 +168,16 @@ LOADER			=	loader
 loader_CPPFLAGS =  $(AM_CFLAGS) $(AM_CPPFLAGS) -I$(top_builddir)/src/
 LOADER_BIN		=	$(abs_top_builddir)/examples/$(LOADER)
 loader_SOURCES		=	../tests/loader.c
+
+if STARPU_HAVE_AM111
+TESTS_ENVIRONMENT	=	top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
+LOG_COMPILER		=	$(LOADER_BIN)
+else
 TESTS_ENVIRONMENT	=	top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(LOADER_BIN)
 endif
 
+endif
+
 examplebin_PROGRAMS +=				\
 	basic_examples/hello_world		\
 	basic_examples/vector_scal		\

+ 7 - 39
examples/filters/custom_mf/custom_interface.c

@@ -17,13 +17,7 @@
 #include "custom_interface.h"
 #include "custom_types.h"
 
-static int copy_ram_to_ram(void *src_interface, unsigned src_node,
-			   void *dst_interface, unsigned dst_node);
 #ifdef STARPU_USE_CUDA
-static int copy_ram_to_cuda(void *src_interface, unsigned src_node,
-			    void *dst_interface, unsigned dst_node);
-static int copy_cuda_to_ram(void *src_interface, unsigned src_node,
-			    void *dst_interface, unsigned dst_node);
 static int copy_ram_to_cuda_async(void *src_interface, unsigned src_node,
 				  void *dst_interface, unsigned dst_node,
 				  cudaStream_t stream);
@@ -54,11 +48,11 @@ static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node,
 
 static struct starpu_data_copy_methods custom_copy_data_methods_s =
 {
-	.ram_to_ram = copy_ram_to_ram,
+	.ram_to_ram = NULL,
 	.ram_to_spu = NULL,
 #ifdef STARPU_USE_CUDA
-	.ram_to_cuda        = copy_ram_to_cuda,
-	.cuda_to_ram        = copy_cuda_to_ram,
+	.ram_to_cuda        = NULL,
+	.cuda_to_ram        = NULL,
 	.ram_to_cuda_async  = copy_ram_to_cuda_async,
 	.cuda_to_ram_async  = copy_cuda_to_ram_async,
 	.cuda_to_cuda       = copy_cuda_to_cuda,
@@ -87,7 +81,6 @@ static void*    custom_handle_to_pointer(starpu_data_handle_t data_handle,
 static void     free_custom_buffer_on_node(void *data_interface, uint32_t node);
 static size_t   custom_interface_get_size(starpu_data_handle_t handle);
 static uint32_t footprint_custom_interface_crc32(starpu_data_handle_t handle);
-static int      custom_compare(void *data_interface_a, void *data_interface_b);
 static void     display_custom_interface(starpu_data_handle_t handle, FILE *f);
 static uint32_t custom_get_nx(starpu_data_handle_t handle);
 
@@ -109,7 +102,7 @@ static struct starpu_data_interface_ops interface_custom_ops =
 	.copy_methods          = &custom_copy_data_methods_s,
 	.get_size              = custom_interface_get_size,
 	.footprint             = footprint_custom_interface_crc32,
-	.compare               = custom_compare,
+	.compare               = NULL,
 #ifdef STARPU_USE_GORDON
 	.convert_to_gordon     = NULL,
 #endif
@@ -325,16 +318,11 @@ static uint32_t footprint_custom_interface_crc32(starpu_data_handle_t handle)
 	return starpu_crc32_be(custom_get_nx(handle), 0);
 }
 
-static int custom_compare(void *data_interface_a, void *data_interface_b)
-{
-	/* TODO */
-	assert(0);
-}
-
 static void display_custom_interface(starpu_data_handle_t handle, FILE *f)
 {
-	/* TODO */
-	assert(0);
+	struct custom_data_interface *ci = (struct custom_interface *)
+		starpu_data_get_interface_on_node(handle, 0);
+	fprintf(f, "Custom interface of size %d", ci->nx);
 }
 
 static uint32_t
@@ -353,7 +341,6 @@ void custom_data_register(starpu_data_handle_t *handle,
 				 uint32_t nx,
 				 struct starpu_multiformat_data_interface_ops *format_ops)
 {
-	/* XXX Deprecated fields ? */
 	struct custom_data_interface custom =
 	{
 		.cpu_ptr = ptr,
@@ -373,26 +360,7 @@ void custom_data_register(starpu_data_handle_t *handle,
 	starpu_data_register(handle, home_node, &custom, &interface_custom_ops);
 }
 
-static int copy_ram_to_ram(void *src_interface, unsigned src_node,
-			   void *dst_interface, unsigned dst_node)
-{
-	/* TODO */
-	assert(0);
-}
 #ifdef STARPU_USE_CUDA
-static int copy_ram_to_cuda(void *src_interface, unsigned src_node,
-			    void *dst_interface, unsigned dst_node)
-{
-	/* TODO */
-	assert(0);
-}
-static int copy_cuda_to_ram(void *src_interface, unsigned src_node,
-			    void *dst_interface, unsigned dst_node)
-{
-	/* TODO */
-	assert(0);
-}
-
 static int
 copy_cuda_common_async(void *src_interface, unsigned src_node,
 		       void *dst_interface, unsigned dst_node,

+ 4 - 1
gcc-plugin/Makefile.am

@@ -13,7 +13,10 @@
 #
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
-SUBDIRS = src tests examples
+SUBDIRS = src tests
+if BUILD_EXAMPLES
+SUBDIRS += examples
+endif
 
 EXTRA_DIST = COPYING README ChangeLog
 

+ 1 - 5
gcc-plugin/examples/vector_scal/vector_scal.c

@@ -172,9 +172,7 @@ main (void)
 #define FACTOR 3.14
 
   {
-    float vector[NX] __attribute__ ((heap_allocated));
-
-#pragma starpu register vector
+    float vector[NX] __attribute__ ((heap_allocated, registered));
 
     size_t i;
     for (i = 0; i < NX; i++)
@@ -184,8 +182,6 @@ main (void)
 
 #pragma starpu wait
 
-#pragma starpu unregister vector
-
     valid = check (NX, vector, FACTOR);
 
   } /* VECTOR is automatically freed here.  */

+ 117 - 2
gcc-plugin/src/starpu.c

@@ -125,6 +125,7 @@ static const char task_attribute_name[] = "task";
 static const char task_implementation_attribute_name[] = "task_implementation";
 static const char output_attribute_name[] = "output";
 static const char heap_allocated_attribute_name[] = "heap_allocated";
+static const char registered_attribute_name[] = "registered";
 
 /* Names of attributes used internally.  */
 static const char task_codelet_attribute_name[] = ".codelet";
@@ -178,6 +179,7 @@ static bool implicit_cpu_task_implementation_p (const_tree fn);
 static int task_implementation_target_to_int (const_tree target);
 
 static bool heap_allocated_p (const_tree var_decl);
+static bool registered_p (const_tree var_decl);
 
 static tree declare_codelet (tree task_decl);
 
@@ -1997,6 +1999,7 @@ handle_heap_allocated_attribute (tree *node, tree name, tree args,
       /* Turn VAR into a pointer that feels like an array.  This is what's
 	 done for PARM_DECLs that have an array type.  */
 
+      location_t loc = DECL_SOURCE_LOCATION (var);
       tree array_type = TREE_TYPE (var);
       tree element_type = TREE_TYPE (array_type);
       tree pointer_type = build_pointer_type (element_type);
@@ -2020,7 +2023,6 @@ handle_heap_allocated_attribute (tree *node, tree name, tree args,
 				    build_addr (var, current_function_decl),
 				    TYPE_SIZE_UNIT (array_type));
       TREE_SIDE_EFFECTS (alloc) = true;
-      add_stmt (alloc);
 
       /* Add a destructor for VAR.  Instead of consing the `cleanup'
 	 attribute for VAR, directly use `push_cleanup'.  This guarantees
@@ -2032,7 +2034,99 @@ handle_heap_allocated_attribute (tree *node, tree name, tree args,
       static tree cleanup_decl;
       LOOKUP_STARPU_FUNCTION (cleanup_decl, "starpu_free");
 
-      push_cleanup (var, build_call_expr (cleanup_decl, 1, var), false);
+      if (registered_p (var))
+	{
+	  /* A `registered' attribute has already been processed, and thus a
+	     cleanup for it has been pushed.  However, we want that cleanup
+	     to appear before ours, and our allocation to appear before the
+	     registration, so swap them.  */
+	  tree_stmt_iterator it;
+	  tree parent, try_finally, registration;
+
+#ifdef stmt_list_stack
+	  parent = VEC_last (tree, stmt_list_stack);
+#else  /* 4.6 and before */
+	  parent = TREE_CHAIN (cur_stmt_list);
+#endif
+
+	  gcc_assert (parent != NULL_TREE
+		      && TREE_CODE (parent) == STATEMENT_LIST);
+
+	  it = tsi_last (parent);
+	  try_finally = tsi_stmt (it);
+	  gcc_assert (TREE_CODE (try_finally) == TRY_FINALLY_EXPR);
+
+	  tsi_prev (&it);
+	  registration =
+	    build_data_register_call (loc, var,
+				      array_type_element_count
+				       (loc, array_type));
+
+	  add_stmt (registration);
+	  *tsi_stmt_ptr (it) = alloc;
+
+	  push_cleanup (var, build_data_unregister_call (loc, var), false);
+	  TREE_OPERAND (try_finally, 1) = build_call_expr (cleanup_decl, 1, var);
+	}
+      else
+	{
+	  /* Push the allocation and cleanup in order.  */
+	  add_stmt (alloc);
+	  push_cleanup (var, build_call_expr (cleanup_decl, 1, var), false);
+	}
+
+      /* Keep the attribute.  */
+      *no_add_attrs = false;
+    }
+
+  return NULL_TREE;
+}
+
+/* Handle the `registered' attribute on variable *NODE.  */
+
+static tree
+handle_registered_attribute (tree *node, tree name, tree args,
+			     int flags, bool *no_add_attrs)
+{
+  location_t loc;
+  tree var = *node;
+
+  loc = DECL_SOURCE_LOCATION (var);
+
+  bool heap_p = heap_allocated_p (var);
+
+  /* When VAR has the `heap_allocated' attribute, we know it has a complete
+     array type.  */
+
+  if (heap_p
+      || automatic_array_variable_p (registered_attribute_name, var))
+    {
+      /* FIXME: This warning cannot be emitted here, because the
+	 `heap_allocated' attribute may be processed later.  */
+      /* if (!heap_p */
+      /* 	  && !MAIN_NAME_P (DECL_NAME (current_function_decl))) */
+      /* 	warning_at (loc, 0, "using an on-stack array as a task input " */
+      /* 		    "considered unsafe"); */
+
+      tree ptr_type, heap_attr =
+	lookup_attribute (heap_allocated_orig_type_attribute_name,
+			  DECL_ATTRIBUTES (var));
+
+      if (heap_attr != NULL_TREE)
+	/* PTR is `heap_allocated' so use its original array type to
+	   determine its size.  */
+	ptr_type = TREE_VALUE (heap_attr);
+      else
+	ptr_type = TREE_TYPE (var);
+
+      tree count = array_type_element_count (loc, ptr_type);
+
+      add_stmt (build_data_register_call (loc, var, count));
+
+      push_cleanup (var,
+		    build_data_unregister_call (DECL_SOURCE_LOCATION (var),
+						var),
+		    false);
     }
 
   return NULL_TREE;
@@ -2247,6 +2341,17 @@ heap_allocated_p (const_tree var_decl)
 			   DECL_ATTRIBUTES (var_decl)) != NULL_TREE;
 }
 
+/* Return true when VAR_DECL has the `registered' attribute.  */
+
+static bool
+registered_p (const_tree var_decl)
+{
+  gcc_assert (TREE_CODE (var_decl) == VAR_DECL);
+
+  return lookup_attribute (registered_attribute_name,
+			   DECL_ATTRIBUTES (var_decl)) != NULL_TREE;
+}
+
 /* Return true if TYPE is `output'-qualified.  */
 
 static bool
@@ -2301,6 +2406,15 @@ register_task_attributes (void *gcc_data, void *user_data)
 #endif
     };
 
+  static const struct attribute_spec registered_attr =
+    {
+      registered_attribute_name, 0, 0, true, false, false,
+      handle_registered_attribute
+#ifdef HAVE_ATTRIBUTE_SPEC_AFFECTS_TYPE_IDENTITY
+      , false
+#endif
+    };
+
   static const struct attribute_spec output_attr =
     {
       output_attribute_name, 0, 0, true, true, false,
@@ -2313,6 +2427,7 @@ register_task_attributes (void *gcc_data, void *user_data)
   register_attribute (&task_attr);
   register_attribute (&task_implementation_attr);
   register_attribute (&heap_allocated_attr);
+  register_attribute (&registered_attr);
   register_attribute (&output_attr);
 }
 

+ 6 - 0
gcc-plugin/tests/Makefile.am

@@ -21,6 +21,8 @@ gcc_tests =					\
   output-pointer-errors.c			\
   register.c					\
   register-errors.c				\
+  registered.c					\
+  registered-errors.c				\
   acquire.c					\
   acquire-errors.c				\
   release.c					\
@@ -88,7 +90,11 @@ EXTRA_DIST += ./run-test.in			\
 if RUN_GCC_PLUGIN_TESTS
 
 TESTS = $(gcc_tests)
+if STARPU_HAVE_AM111
+LOG_COMPILER = ./run-test
+else
 TESTS_ENVIRONMENT = ./run-test
+endif
 
 else !RUN_GCC_PLUGIN_TESTS
 

+ 5 - 2
gcc-plugin/tests/base.c

@@ -133,19 +133,22 @@ main (int argc, char *argv[])
 
   my_scalar_task (42, y_as_long_int, 99);
 
+  assert (tasks_submitted == 9);
+
   struct insert_task_argument expected2[] =
     {
       { STARPU_VALUE, &x, sizeof x },
       { 0, 0, 0 }
     };
 
+  tasks_submitted = 0;
   expected_insert_task_arguments = expected2;
 
   my_other_task (42);
+  assert (tasks_submitted == 1);
 
   my_task_with_body (42);
-
-  assert (tasks_submitted == 11);
+  assert (tasks_submitted == 2);
 
 #pragma starpu shutdown
   assert (initialized == 0);

+ 9 - 1
gcc-plugin/tests/mocks.h

@@ -296,7 +296,15 @@ starpu_vector_data_register (starpu_data_handle_t *handle,
 			     uint32_t home_node, uintptr_t ptr,
 			     uint32_t count, size_t elemsize)
 {
-  assert ((void *) ptr == expected_register_arguments.pointer);
+  /* Sometimes tests cannot tell what the pointer will be (for instance, for
+     the `registered' attribute), and thus pass NULL as the expected
+     pointer.  */
+  if (expected_register_arguments.pointer != NULL)
+    assert ((void *) ptr == expected_register_arguments.pointer);
+  else
+    /* Allow users to check the pointer afterward.  */
+    expected_register_arguments.pointer = (void *) ptr;
+
   assert (count == expected_register_arguments.elements);
   assert (elemsize == expected_register_arguments.element_size);
 

+ 36 - 0
gcc-plugin/tests/registered-errors.c

@@ -0,0 +1,36 @@
+/* GCC-StarPU
+   Copyright (C) 2012 Institut National de Recherche en Informatique et Automatique
+
+   GCC-StarPU is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   GCC-StarPU is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC-StarPU.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* (instructions compile (cflags "-Wno-unused-variable")) */
+
+static int global[123]              /* (error "cannot be used") */
+  __attribute__ ((registered, used));
+
+extern int external[123]            /* (error "cannot be used") */
+  __attribute__ ((registered));
+
+void
+foo (size_t size)
+{
+  float scalar /* (error "must have an array type") */
+    __attribute__ ((registered));
+  float *ptr   /* (error "must have an array type") */
+    __attribute__ ((registered));
+  float incomp[]  /* (error "incomplete array type") */
+    __attribute__ ((registered));
+  float incomp2[size][3][]  /* (error "incomplete element type") */
+    __attribute__ ((registered));
+}

+ 128 - 0
gcc-plugin/tests/registered.c

@@ -0,0 +1,128 @@
+/* GCC-StarPU
+   Copyright (C) 2012 Institut National de Recherche en Informatique et Automatique
+
+   GCC-StarPU is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   GCC-StarPU is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC-StarPU.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#undef NDEBUG
+
+#include <mocks.h>
+#include <stdlib.h>
+
+static void
+test_vec (void)
+{
+  data_register_calls = data_unregister_calls = 0;
+  expected_register_arguments.pointer = NULL;
+  expected_register_arguments.elements = 123;
+  expected_register_arguments.element_size = sizeof (float);
+
+  float vec[123]		    /* FIXME: warning: "considered unsafe" */
+    __attribute__ ((registered));
+
+  assert (data_register_calls == 1);
+  assert (expected_register_arguments.pointer == vec);
+
+  expected_unregister_arguments.pointer = vec;
+}
+
+static void
+test_matrix (void)
+{
+  data_register_calls = data_unregister_calls = 0;
+  expected_register_arguments.pointer = NULL;
+  expected_register_arguments.elements = 123;
+  expected_register_arguments.element_size = 234 * sizeof (double);
+
+  double matrix[123][234]	     /* FIXME: warning "considered unsafe" */
+    __attribute__ ((registered));
+
+  assert (data_register_calls == 1);
+  assert (expected_register_arguments.pointer == matrix);
+
+  expected_unregister_arguments.pointer = matrix;
+}
+
+static void
+test_with_heap_alloc (void)
+{
+  data_register_calls = data_unregister_calls = 0;
+  malloc_calls = free_calls = 0;
+
+  expected_register_arguments.pointer = NULL;
+  expected_register_arguments.elements = 123;
+  expected_register_arguments.element_size =
+     234 * 77 * sizeof (int);
+  expected_malloc_argument =
+    expected_register_arguments.elements
+    * expected_register_arguments.element_size;
+
+  int matrix[123][234][77]
+    __attribute__ ((registered, heap_allocated));
+
+  assert (data_register_calls == 1);
+  assert (expected_register_arguments.pointer == matrix);
+  assert (malloc_calls == 1);
+
+  expected_unregister_arguments.pointer = matrix;
+  expected_free_argument = matrix;
+}
+
+/* Same as above, but with the attributes in reverse order.  */
+static void
+test_with_heap_alloc_reversed (void)
+{
+  data_register_calls = data_unregister_calls = 0;
+  malloc_calls = free_calls = 0;
+
+  expected_register_arguments.pointer = NULL;
+  expected_register_arguments.elements = 123;
+  expected_register_arguments.element_size =
+     234 * 77 * sizeof (int);
+  expected_malloc_argument =
+    expected_register_arguments.elements
+    * expected_register_arguments.element_size;
+
+  int matrix[123][234][77]
+    __attribute__ ((heap_allocated, registered));
+
+  assert (data_register_calls == 1);
+  assert (expected_register_arguments.pointer == matrix);
+  assert (malloc_calls == 1);
+
+  expected_unregister_arguments.pointer = matrix;
+  expected_free_argument = matrix;
+}
+
+
+int
+main (int argc, char *argv[])
+{
+#pragma starpu initialize
+
+  test_vec ();
+  assert (data_unregister_calls == 1);
+
+  test_matrix ();
+  assert (data_unregister_calls == 1);
+
+  test_with_heap_alloc ();
+  assert (data_unregister_calls == 1);
+  assert (free_calls == 1);
+
+  test_with_heap_alloc_reversed ();
+  assert (data_unregister_calls == 1);
+  assert (free_calls == 1);
+
+  return EXIT_SUCCESS;
+}

+ 16 - 0
gcc-plugin/tests/task-errors.c

@@ -78,6 +78,22 @@ void my_task_with_too_many_pointer_params (/* (error "maximum .* exceeded") */
   __attribute__ ((task));
 
 
+static void my_task_without_any_parameters (void)
+  __attribute__ ((task));
+
+static void my_task_without_any_parameters_gordon (void)
+  __attribute__ ((task_implementation ("gordon", my_task_without_any_parameters)));
+
+void
+my_task_without_any_parameters (void)
+{
+}
+
+void
+my_task_without_any_parameters_gordon (void)
+{
+}
+
 
 static void
 my_task_cpu (int foo, float *bar)

+ 5 - 5
include/starpu.h

@@ -35,6 +35,10 @@ typedef unsigned long long uint64_t;
 #include <windows.h>
 #endif
 
+#if defined(STARPU_USE_OPENCL) && !defined(__CUDACC__)
+#include <starpu_opencl.h>
+#endif
+
 #include <starpu_util.h>
 #include <starpu_data.h>
 #include <starpu_data_interfaces.h>
@@ -59,10 +63,6 @@ extern "C"
 {
 #endif
 
-#if defined(STARPU_USE_OPENCL) && !defined(__CUDACC__)
-#include <starpu_opencl.h>
-#endif
-
 enum starpu_archtype
 {
 	STARPU_CPU_WORKER,    /* CPU core */
@@ -82,7 +82,7 @@ struct starpu_driver
 		cl_device_id opencl_id;
 #endif
 		/*
-		 * TODO: handle CPUs:
+		 * HOWTO: add a new kind of device to the starpu_driver structure.
 		 * 1) Add a member to this union.
 		 * 2) Edit _starpu_launch_drivers() to make sure the driver is
 		 *    not always launched.

+ 1 - 0
include/starpu_config.h.in

@@ -68,6 +68,7 @@
 #undef STARPU_MAXCPUS
 #undef STARPU_MAXCUDADEVS
 #undef STARPU_MAXOPENCLDEVS
+#undef STARPU_MAXGORDONDEVS
 #undef STARPU_NMAXWORKERS
 #undef STARPU_NMAX_SCHED_CTXS
 #undef STARPU_MAXIMPLEMENTATIONS

+ 4 - 6
include/starpu_data_interfaces.h

@@ -77,13 +77,11 @@ struct starpu_data_copy_methods
 	int (*cuda_to_cuda_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cudaStream_t stream);
 #endif
 
-#ifdef STARPU_USE_OPENCL
+#if defined(STARPU_USE_OPENCL) && !defined(__CUDACC__)
 	/* for asynchronous OpenCL transfers */
-	/* XXX we do not use a cl_event *event type for the last argument
-	 * because nvcc does not like when we have to include OpenCL headers */
-        int (*ram_to_opencl_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, /* cl_event * */ void *event);
-	int (*opencl_to_ram_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, /* cl_event * */ void *event);
-	int (*opencl_to_opencl_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, /* cl_event * */ void *event);
+        int (*ram_to_opencl_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event);
+	int (*opencl_to_ram_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event);
+	int (*opencl_to_opencl_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event);
 #endif
 };
 

+ 1 - 0
include/starpu_opencl.h

@@ -25,6 +25,7 @@
 #include <CL/cl.h>
 #endif
 #include <starpu_config.h>
+#include <assert.h>
 
 #ifdef __cplusplus
 extern "C"

+ 7 - 2
mpi/Makefile.am

@@ -18,7 +18,11 @@ CC=$(MPICC)
 CCLD=$(MPICC)
 
 if STARPU_MPI_CHECK
-TESTS_ENVIRONMENT	=	$(MPIEXEC) -np 2
+if STARPU_HAVE_AM111
+LOG_COMPILER	 	=	$(MPIEXEC) -np 2
+else
+TESTS_ENVIRONMENT 	=	$(MPIEXEC) -np 2
+endif
 TESTS			=	$(check_PROGRAMS)
 endif
 
@@ -94,7 +98,7 @@ libstarpumpi_@STARPU_EFFECTIVE_VERSION@_la_SOURCES =	\
 ###################
 # Stencil example #
 ###################
-
+if BUILD_EXAMPLES
 examplebin_PROGRAMS +=				\
 	examples/stencil/stencil5
 
@@ -219,6 +223,7 @@ examples_complex_mpi_complex_LDADD =		\
 
 check_PROGRAMS	+=	\
 	examples/complex/mpi_complex
+endif
 
 ########################
 # Unit testcases       #

+ 7 - 0
socl/examples/Makefile.am

@@ -35,9 +35,16 @@ LOADER			=	loader
 loader_CPPFLAGS 	=	$(AM_CFLAGS) $(AM_CPPFLAGS) -I$(top_builddir)/src/
 LOADER_BIN		=	$(abs_top_builddir)/socl/examples/$(LOADER)
 loader_SOURCES		=	../../tests/loader.c
+
+if STARPU_HAVE_AM111
+TESTS_ENVIRONMENT	=	top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
+LOG_COMPILER		=	$(LOADER_BIN)
+else
 TESTS_ENVIRONMENT	=	top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(LOADER_BIN)
 endif
 
+endif
+
 examplebindir = $(libdir)/starpu/examples/socl/
 examplebin_PROGRAMS =
 

+ 1 - 1
src/Makefile.am

@@ -34,7 +34,7 @@ ldflags += -Xlinker --output-def -Xlinker .libs/libstarpu-@STARPU_EFFECTIVE_VERS
 
 if STARPU_HAVE_MS_LIB
 .libs/libstarpu-@STARPU_EFFECTIVE_VERSION@.lib: libstarpu-@STARPU_EFFECTIVE_VERSION@.la dolib
-	./dolib "$(STARPU_MS_LIB)" $(STARPU_MS_LIB_ARCH) .libs/libstarpu-@STARPU_EFFECTIVE_VERSION@.def $(libstarpu_so_version) .libs/libstarpu-@STARPU_EFFECTIVE_VERSION@.lib
+	./dolib "$(STARPU_MS_LIB)" $(STARPU_MS_LIB_ARCH) .libs/libstarpu-@STARPU_EFFECTIVE_VERSION@.def @STARPU_EFFECTIVE_VERSION@ $(libstarpu_so_version) .libs/libstarpu-@STARPU_EFFECTIVE_VERSION@.lib
 all-local: .libs/libstarpu-@STARPU_EFFECTIVE_VERSION@.lib
 endif STARPU_HAVE_MS_LIB
 

+ 1 - 1
src/common/fxt.c

@@ -53,7 +53,7 @@ long _starpu_gettid()
 	thr_self(&tid);
 	return tid;
 #elif defined(__MINGW32__)
-	return (long) GetCurrentThread();
+	return (long) GetCurrentThreadId();
 #else
 	return (long) pthread_self();
 #endif

+ 2 - 3
src/core/perfmodel/perfmodel_history.c

@@ -283,7 +283,6 @@ static void parse_model_file(FILE *f, struct starpu_perfmodel *model, unsigned s
 {
 	unsigned ret;
 	unsigned archmin = 0;
-	unsigned max_gordondevs = 1; /* XXX : we need a STARPU_MAXGORDONDEVS cst */
 	unsigned narchs;
 
 	/* We could probably write a clean loop here, but the code would not
@@ -343,8 +342,8 @@ static void parse_model_file(FILE *f, struct starpu_perfmodel *model, unsigned s
 	{
 		parse_arch(f, model, scan_history,
 			   archmin,
-			   archmin + max_gordondevs,
-			   narchs > max_gordondevs ? narchs - max_gordondevs : 0);
+			   archmin + STARPU_MAXGORDONDEVS,
+			   narchs > STARPU_MAXGORDONDEVS ? narchs - STARPU_MAXGORDONDEVS : 0);
 	}
 }
 

+ 0 - 16
src/core/sched_policy.c

@@ -32,22 +32,6 @@ int starpu_get_prefetch_flag(void)
 	return use_prefetch;
 }
 
-/*
- *	Predefined policies
- */
-
-extern struct starpu_sched_policy _starpu_sched_ws_policy;
-extern struct starpu_sched_policy _starpu_sched_prio_policy;
-extern struct starpu_sched_policy _starpu_sched_random_policy;
-extern struct starpu_sched_policy _starpu_sched_dm_policy;
-extern struct starpu_sched_policy _starpu_sched_dmda_policy;
-extern struct starpu_sched_policy _starpu_sched_dmda_ready_policy;
-extern struct starpu_sched_policy _starpu_sched_dmda_sorted_policy;
-extern struct starpu_sched_policy _starpu_sched_eager_policy;
-extern struct starpu_sched_policy _starpu_sched_parallel_heft_policy;
-extern struct starpu_sched_policy _starpu_sched_pgreedy_policy;
-extern struct starpu_sched_policy _starpu_sched_heft_policy;
-
 static struct starpu_sched_policy *predefined_policies[] =
 {
 	&_starpu_sched_ws_policy,

+ 16 - 0
src/core/sched_policy.h

@@ -45,5 +45,21 @@ struct starpu_task *_starpu_create_conversion_task(starpu_data_handle_t handle,
 
 void _starpu_sched_pre_exec_hook(struct starpu_task *task);
 
+/*
+ *	Predefined policies
+ */
+extern struct starpu_sched_policy _starpu_sched_ws_policy;
+extern struct starpu_sched_policy _starpu_sched_prio_policy;
+extern struct starpu_sched_policy _starpu_sched_random_policy;
+extern struct starpu_sched_policy _starpu_sched_dm_policy;
+extern struct starpu_sched_policy _starpu_sched_dmda_policy;
+extern struct starpu_sched_policy _starpu_sched_dmda_ready_policy;
+extern struct starpu_sched_policy _starpu_sched_dmda_sorted_policy;
+extern struct starpu_sched_policy _starpu_sched_eager_policy;
+extern struct starpu_sched_policy _starpu_sched_parallel_heft_policy;
+extern struct starpu_sched_policy _starpu_sched_pgreedy_policy;
+extern struct starpu_sched_policy _starpu_sched_heft_policy;
+
+
 #endif // __SCHED_POLICY_H__
 

+ 2 - 2
src/core/topology.c

@@ -906,7 +906,7 @@ void starpu_topology_print(FILE *output)
 	unsigned ncombinedworkers = topology->ncombinedworkers;
 
 	for (core = 0; core < topology->nhwcpus; core++) {
-		fprintf(output, "core %d\t", core);
+		fprintf(output, "core %u\t", core);
 		for (worker = 0; worker < nworkers + ncombinedworkers; worker++)
 		{
 			if (worker < nworkers)
@@ -926,7 +926,7 @@ void starpu_topology_print(FILE *output)
 				for (i = 0; i < worker_size; i++)
 				{
 					if (topology->workers_bindid[combined_workerid[i]] == core)
-						fprintf(output, "comb %d\t", worker-nworkers);
+						fprintf(output, "comb %u\t", worker-nworkers);
 				}
 			}
 		}

+ 7 - 1
src/core/workers.h

@@ -62,7 +62,7 @@ struct _starpu_worker
 	uint32_t worker_mask; /* what is the type of worker ? */
 	enum starpu_perf_archtype perf_arch; /* in case there are different models of the same arch */
 	pthread_t worker_thread; /* the thread which runs the worker */
-	int devid; /* which cpu/gpu/etc is controlled by the workker ? */
+	unsigned devid; /* which cpu/gpu/etc is controlled by the worker ? */
 	int bindid; /* which cpu is the driver bound to ? (logical index) */
 	int workerid; /* uniquely identify the worker among all processing units types */
 	int combined_workerid; /* combined worker currently using this worker */
@@ -245,5 +245,11 @@ struct _starpu_sched_ctx* _starpu_get_initial_sched_ctx(void);
 
 int starpu_worker_get_nids_by_type(enum starpu_archtype type, int *workerids, int maxsize);
 
+int starpu_asynchronous_copy_disabled();
+
+int starpu_asynchronous_cuda_copy_disabled();
+
+int starpu_asynchronous_opencl_copy_disabled();
+
 #endif // __WORKERS_H__
 

+ 6 - 6
src/datawizard/interfaces/block_interface.c

@@ -38,8 +38,8 @@ static int copy_cuda_to_cuda(void *src_interface, unsigned src_node STARPU_ATTRI
 #ifdef STARPU_USE_OPENCL
 static int copy_ram_to_opencl(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED);
 static int copy_opencl_to_ram(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED);
-static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event);
-static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event);
+static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event);
+static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event);
 #endif
 
 static struct starpu_data_copy_methods block_copy_data_methods_s =
@@ -585,7 +585,7 @@ static int copy_ram_to_cuda_async(void *src_interface, unsigned src_node STARPU_
 #endif // STARPU_USE_CUDA
 
 #ifdef STARPU_USE_OPENCL
-static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event)
+static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event)
 {
 	struct starpu_block_interface *src_block = src_interface;
 	struct starpu_block_interface *dst_block = dst_interface;
@@ -603,7 +603,7 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARP
 		{
                         err = starpu_opencl_copy_ram_to_opencl((void*)src_block->ptr, src_node, (cl_mem)dst_block->dev_handle, dst_node,
 							       src_block->nx*src_block->ny*src_block->nz*src_block->elemsize,
-							       dst_block->offset, (cl_event*)_event, &ret);
+							       dst_block->offset, event, &ret);
                         if (STARPU_UNLIKELY(err))
                                 STARPU_OPENCL_REPORT_ERROR(err);
                 }
@@ -654,7 +654,7 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARP
 	return ret;
 }
 
-static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event)
+static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event)
 {
 	struct starpu_block_interface *src_block = src_interface;
 	struct starpu_block_interface *dst_block = dst_interface;
@@ -669,7 +669,7 @@ static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARP
 		{
                         err = starpu_opencl_copy_opencl_to_ram((cl_mem)src_block->dev_handle, src_node, (void*)dst_block->ptr, dst_node,
 							       src_block->nx*src_block->ny*src_block->nz*src_block->elemsize,
-							       src_block->offset, (cl_event*)_event, &ret);
+							       src_block->offset, event, &ret);
                         if (STARPU_UNLIKELY(err))
                                 STARPU_OPENCL_REPORT_ERROR(err);
                 }

+ 1 - 0
src/datawizard/interfaces/data_interface.c

@@ -22,6 +22,7 @@
 #include <common/uthash.h>
 #include <common/starpu_spinlock.h>
 #include <core/task.h>
+#include <core/workers.h>
 
 /* Entry in the `registered_handles' hash table.  */
 struct handle_entry

+ 6 - 6
src/datawizard/interfaces/matrix_interface.c

@@ -42,8 +42,8 @@ static int copy_cuda_to_cuda_async(void *src_interface, unsigned src_node STARPU
 #ifdef STARPU_USE_OPENCL
 static int copy_ram_to_opencl(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED);
 static int copy_opencl_to_ram(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED);
-static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event);
-static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event);
+static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event);
+static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event);
 #endif
 
 static struct starpu_data_copy_methods matrix_copy_data_methods_s =
@@ -597,7 +597,7 @@ static int copy_cuda_to_cuda_async(void *src_interface, unsigned src_node STARPU
 #endif // STARPU_USE_CUDA
 
 #ifdef STARPU_USE_OPENCL
-static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event)
+static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event)
 {
 	struct starpu_matrix_interface *src_matrix = src_interface;
 	struct starpu_matrix_interface *dst_matrix = dst_interface;
@@ -607,7 +607,7 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARP
 
 	err = starpu_opencl_copy_ram_to_opencl((void*)src_matrix->ptr, src_node, (cl_mem)dst_matrix->dev_handle, dst_node,
 					       src_matrix->nx*src_matrix->ny*src_matrix->elemsize,
-					       dst_matrix->offset, (cl_event*)_event, &ret);
+					       dst_matrix->offset, event, &ret);
         if (STARPU_UNLIKELY(err))
                 STARPU_OPENCL_REPORT_ERROR(err);
 
@@ -616,7 +616,7 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARP
 	return ret;
 }
 
-static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event)
+static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event)
 {
 	struct starpu_matrix_interface *src_matrix = src_interface;
 	struct starpu_matrix_interface *dst_matrix = dst_interface;
@@ -626,7 +626,7 @@ static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARP
 
         err = starpu_opencl_copy_opencl_to_ram((cl_mem)src_matrix->dev_handle, src_node, (void*)dst_matrix->ptr, dst_node,
 					       src_matrix->nx*src_matrix->ny*src_matrix->elemsize,
-					       src_matrix->offset, (cl_event*)_event, &ret);
+					       src_matrix->offset, event, &ret);
 
         if (STARPU_UNLIKELY(err))
                 STARPU_OPENCL_REPORT_ERROR(err);

+ 21 - 8
src/datawizard/interfaces/multiformat_interface.c

@@ -1,6 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012  Institut National de Recherche en Informatique et Automatique
+ * Copyright (C) 2012       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
@@ -37,8 +38,8 @@ static int copy_cuda_to_cuda_async(void *src_interface, unsigned src_node,					v
 static int copy_ram_to_opencl(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node);
 static int copy_opencl_to_ram(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node);
 static int copy_opencl_to_opencl(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node);
-static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node, void *_event);
-static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node, void *_event);
+static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node, cl_event *event);
+static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node, cl_event *event);
 #endif
 
 static struct starpu_data_copy_methods multiformat_copy_data_methods_s =
@@ -214,7 +215,6 @@ static int multiformat_compare(void *data_interface_a, void *data_interface_b)
 
 static void display_multiformat_interface(starpu_data_handle_t handle, FILE *f)
 {
-	/* TODO */
 	struct starpu_multiformat_interface *multiformat_interface;
 	multiformat_interface = (struct starpu_multiformat_interface *)
 		starpu_data_get_interface_on_node(handle, 0);
@@ -267,7 +267,20 @@ static void free_multiformat_buffer_on_node(void *data_interface, uint32_t node)
 #endif
 #ifdef STARPU_USE_OPENCL
 		case STARPU_OPENCL_RAM:
-			STARPU_ASSERT_MSG(0, "XXX multiformat not supported on OpenCL yet (TODO)");
+			if (multiformat_interface->cpu_ptr)
+			{
+				cl_int err = clReleaseMemObject(multiformat_interface->cpu_ptr);
+				if (err != CL_SUCCESS)
+					STARPU_OPENCL_REPORT_ERROR(err);
+				multiformat_interface->cpu_ptr = NULL;
+			}
+			if (multiformat_interface->opencl_ptr)
+			{
+				cl_int err = clReleaseMemObject(multiformat_interface->opencl_ptr);
+				if (err != CL_SUCCESS)
+					STARPU_OPENCL_REPORT_ERROR(err);
+				multiformat_interface->opencl_ptr = NULL;
+			}
 			break;
 #endif
 		default:
@@ -620,7 +633,7 @@ static int copy_cuda_to_cuda_async(void *src_interface, unsigned src_node,
 #ifdef STARPU_USE_OPENCL
 static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node,
 				    void *dst_interface, unsigned dst_node,
-				    void *_event)
+				    cl_event *event)
 {
 	int err, ret;
 	size_t size;
@@ -643,7 +656,7 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node,
 					       dst_node,
 					       size,
 					       0,
-					       (cl_event *) _event,
+					       event,
 					       &ret);
         if (STARPU_UNLIKELY(err))
                 STARPU_OPENCL_REPORT_ERROR(err);
@@ -654,7 +667,7 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node,
 
 static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node,
 				    void *dst_interface, unsigned dst_node,
-				    void *_event)
+				    cl_event *event)
 {
 	int err, ret;
 	size_t size;
@@ -681,7 +694,7 @@ static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node,
 					       dst_node,
 					       size,
 					       0,
-					       (cl_event *)_event,
+					       event,
 					       &ret);
         if (STARPU_UNLIKELY(err))
                 STARPU_OPENCL_REPORT_ERROR(err);

+ 6 - 6
src/datawizard/interfaces/variable_interface.c

@@ -38,8 +38,8 @@ static int copy_cuda_to_cuda(void *src_interface, unsigned src_node, void *dst_i
 static int copy_ram_to_opencl(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED);
 static int copy_opencl_to_ram(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED);
 static int copy_opencl_to_opencl(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED);
-static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event);
-static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event);
+static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event);
+static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event);
 #endif
 
 static struct starpu_data_copy_methods variable_copy_data_methods_s =
@@ -393,14 +393,14 @@ static int copy_cuda_to_cuda_async(void *src_interface, unsigned src_node, void
 
 #ifdef STARPU_USE_OPENCL
 static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface,
-                                    unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event)
+                                    unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event)
 {
 	struct starpu_variable_interface *src_variable = src_interface;
 	struct starpu_variable_interface *dst_variable = dst_interface;
         int err,ret;
 
         err = starpu_opencl_copy_ram_to_opencl((void*)src_variable->ptr, src_node, (cl_mem)dst_variable->ptr, dst_node, src_variable->elemsize,
-					       0, (cl_event*)_event, &ret);
+					       0, event, &ret);
         if (STARPU_UNLIKELY(err))
                 STARPU_OPENCL_REPORT_ERROR(err);
 
@@ -409,14 +409,14 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARP
 	return ret;
 }
 
-static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event)
+static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event)
 {
 	struct starpu_variable_interface *src_variable = src_interface;
 	struct starpu_variable_interface *dst_variable = dst_interface;
         int err, ret;
 
 	err = starpu_opencl_copy_opencl_to_ram((cl_mem)src_variable->ptr, src_node, (void*)dst_variable->ptr, dst_node, src_variable->elemsize,
-					       0, (cl_event*)_event, &ret);
+					       0, event, &ret);
 
         if (STARPU_UNLIKELY(err))
                 STARPU_OPENCL_REPORT_ERROR(err);

+ 7 - 7
src/datawizard/interfaces/vector_interface.c

@@ -38,8 +38,8 @@ static int copy_cuda_to_cuda_async(void *src_interface, unsigned src_node,					v
 static int copy_ram_to_opencl(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node);
 static int copy_opencl_to_ram(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node);
 static int copy_opencl_to_opencl(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node);
-static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node, void *_event);
-static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node, void *_event);
+static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node, cl_event *event);
+static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED, void *dst_interface, unsigned dst_node, cl_event *event);
 #endif
 
 static struct starpu_data_copy_methods vector_copy_data_methods_s =
@@ -439,7 +439,7 @@ static int copy_ram_to_cuda_async(void *src_interface, unsigned src_node, void *
 
 #ifdef STARPU_USE_OPENCL
 static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED,
-                                    void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event)
+                                    void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event)
 {
 	struct starpu_vector_interface *src_vector = src_interface;
 	struct starpu_vector_interface *dst_vector = dst_interface;
@@ -447,7 +447,7 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARP
 
 	err = starpu_opencl_copy_ram_to_opencl((void*)src_vector->ptr, src_node, (cl_mem)dst_vector->dev_handle, dst_node,
 					       src_vector->nx*src_vector->elemsize,
-					       dst_vector->offset, (cl_event*)_event, &ret);
+					       dst_vector->offset, event, &ret);
         if (STARPU_UNLIKELY(err))
                 STARPU_OPENCL_REPORT_ERROR(err);
 
@@ -457,14 +457,14 @@ static int copy_ram_to_opencl_async(void *src_interface, unsigned src_node STARP
 }
 
 static int copy_opencl_to_ram_async(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED,
-                                    void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *_event)
+                                    void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, cl_event *event)
 {
 	struct starpu_vector_interface *src_vector = src_interface;
 	struct starpu_vector_interface *dst_vector = dst_interface;
         int err, ret;
 
 	err = starpu_opencl_copy_opencl_to_ram((cl_mem)src_vector->dev_handle, src_node, (void*)dst_vector->ptr, dst_node, src_vector->nx*src_vector->elemsize,
-					       src_vector->offset, (cl_event *)_event, &ret);
+					       src_vector->offset, event, &ret);
         if (STARPU_UNLIKELY(err))
                 STARPU_OPENCL_REPORT_ERROR(err);
 
@@ -486,7 +486,7 @@ static int copy_opencl_to_ram(void *src_interface, unsigned src_node STARPU_ATTR
 }
 
 static int copy_opencl_to_opencl(void *src_interface, unsigned src_node STARPU_ATTRIBUTE_UNUSED,
-                              void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED)
+				 void *dst_interface, unsigned dst_node STARPU_ATTRIBUTE_UNUSED)
 {
         int err;
 

+ 3 - 3
src/datawizard/interfaces/void_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2012  Université de Bordeaux 1
- * Copyright (C) 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012  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
@@ -30,7 +30,7 @@ static int dummy_copy(void *src_interface, unsigned src_node, void *dst_interfac
 static int dummy_cuda_copy_async(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cudaStream_t stream);
 #endif
 #ifdef STARPU_USE_OPENCL
-static int dummy_opencl_copy_async(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *_event);
+static int dummy_opencl_copy_async(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event);
 #endif
 
 static struct starpu_data_copy_methods void_copy_data_methods_s =
@@ -156,7 +156,7 @@ static int dummy_opencl_copy_async(void *src_interface STARPU_ATTRIBUTE_UNUSED,
 					unsigned src_node STARPU_ATTRIBUTE_UNUSED,
 					void *dst_interface STARPU_ATTRIBUTE_UNUSED,
 					unsigned dst_node STARPU_ATTRIBUTE_UNUSED,
-					void *_event STARPU_ATTRIBUTE_UNUSED)
+					cl_event *event STARPU_ATTRIBUTE_UNUSED)
 {
 	return 0;
 }

+ 5 - 1
src/debug/traces/starpu_fxt.c

@@ -1214,7 +1214,11 @@ void starpu_fxt_generate_trace(struct starpu_fxt_options *options)
 
 	starpu_fxt_paje_file_init(options);
 
-	if (options->ninputfiles == 1)
+	if (options->ninputfiles == 0)
+	{
+	     return;
+	}
+	else if (options->ninputfiles == 1)
 	{
 		/* we usually only have a single trace */
 		uint64_t file_start_time = starpu_fxt_find_start_time(options->filenames[0]);

+ 6 - 5
src/dolib.c

@@ -22,12 +22,12 @@
 
 int main(int argc, char *argv[])
 {
-	char *prog, *arch, *def, *version, *lib;
+	char *prog, *arch, *def, *effective_version, *version, *lib;
 	char s[1024];
 	char name[16];
 	int current, age, revision;
 
-	if (argc != 6)
+	if (argc != 7)
 	{
 		fprintf(stderr,"bad number of arguments");
 		exit(EXIT_FAILURE);
@@ -36,13 +36,14 @@ int main(int argc, char *argv[])
 	prog = argv[1];
 	arch = argv[2];
 	def = argv[3];
-	version = argv[4];
-	lib = argv[5];
+	effective_version = argv[4];
+	version = argv[5];
+	lib = argv[6];
 
 	if (sscanf(version, "%d:%d:%d", &current, &revision, &age) != 3)
 		exit(EXIT_FAILURE);
 
-	_snprintf(name, sizeof(name), "libstarpu-%d", current - age);
+	_snprintf(name, sizeof(name), "libstarpu-%s-%d", effective_version, current - age);
 	printf("using soname %s\n", name);
 
 	_snprintf(s, sizeof(s), "\"%s\" /machine:%s /def:%s /name:%s /out:%s",

+ 3 - 2
src/drivers/cpu/driver_cpu.c

@@ -116,13 +116,14 @@ int _starpu_cpu_driver_init(struct starpu_driver *d)
 	cpu_worker = _starpu_get_worker_from_driver(d);
 	STARPU_ASSERT(cpu_worker);
 
-	unsigned memnode = cpu_worker->memory_node;
 	int devid = cpu_worker->devid;
 
 #ifdef STARPU_USE_FXT
 	_starpu_fxt_register_thread(cpu_worker->bindid);
-#endif
+
+	unsigned memnode = cpu_worker->memory_node;
 	_STARPU_TRACE_WORKER_INIT_START(_STARPU_FUT_CPU_KEY, devid, memnode);
+#endif
 
 	_starpu_bind_thread_on_cpu(cpu_worker->config, cpu_worker->bindid);
 

+ 3 - 2
src/drivers/cuda/driver_cuda.c

@@ -331,12 +331,13 @@ int _starpu_cuda_driver_init(struct starpu_driver *d)
 	STARPU_ASSERT(args);
 
 	int devid = args->devid;
-	unsigned memory_node = args->memory_node;
 
 #ifdef STARPU_USE_FXT
 	_starpu_fxt_register_thread(args->bindid);
+
+	unsigned memnode = args->memory_node;
+	_STARPU_TRACE_WORKER_INIT_START(_STARPU_FUT_CUDA_KEY, devid, memnode);
 #endif
-	_STARPU_TRACE_WORKER_INIT_START(_STARPU_FUT_CUDA_KEY, devid, memory_node);
 
 	_starpu_bind_thread_on_cpu(args->config, args->bindid);
 

+ 1 - 1
src/drivers/opencl/driver_opencl.c

@@ -440,10 +440,10 @@ int _starpu_opencl_driver_init(struct starpu_driver *d)
 
 #ifdef USE_FXT
 	fxt_register_thread(args->bindid);
-#endif
 
 	unsigned memnode = args->memory_node;
 	_STARPU_TRACE_WORKER_INIT_START(_STARPU_FUT_OPENCL_KEY, devid, memnode);
+#endif
 
 	_starpu_bind_thread_on_cpu(args->config, args->bindid);
 

+ 5 - 2
starpufft/Makefile.am

@@ -67,10 +67,13 @@ libstarpufft_@STARPU_EFFECTIVE_VERSION@_la_LIBADD +=  $(STARPU_CUDA_LDFLAGS)
 endif
 
 examplebindir = $(libdir)/starpu/examples/starpufft
-examplebin_PROGRAMS =				\
+
+examplebin_PROGRAMS =
+if BUILD_EXAMPLES
+examplebin_PROGRAMS +=				\
 	examples/testf \
 	examples/test
-
+endif
 check_PROGRAMS = examples/testf
 examples_testf_LDADD = libstarpufft-@STARPU_EFFECTIVE_VERSION@.la $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la $(FFTWF_LIBS)
 

+ 7 - 1
tests/Makefile.am

@@ -15,7 +15,7 @@
 #
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
-AM_CFLAGS = $(HWLOC_CFLAGS) -Wall $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS)
+AM_CFLAGS = $(HWLOC_CFLAGS) $(FXT_CFLAGS) -Wall $(STARPU_CUDA_CPPFLAGS) $(STARPU_OPENCL_CPPFLAGS)
 LIBS = $(top_builddir)/src/libstarpu-@STARPU_EFFECTIVE_VERSION@.la $(HWLOC_LIBS) @LIBS@
 AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_builddir)/src -I$(top_srcdir)/src/
 AM_LDFLAGS = $(STARPU_CUDA_LDFLAGS) $(STARPU_OPENCL_LDFLAGS)
@@ -100,8 +100,14 @@ if !STARPU_HAVE_WINDOWS
 ## test loader program
 LOADER			=	loader
 LOADER_BIN		=	$(abs_top_builddir)/tests/$(LOADER)
+
+if STARPU_HAVE_AM111
+TESTS_ENVIRONMENT	=	top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
+LOG_COMPILER		=	$(LOADER_BIN)
+else
 TESTS_ENVIRONMENT	=	top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(LOADER_BIN)
 endif
+endif
 
 TESTS = $(noinst_PROGRAMS)
 

+ 4 - 2
tests/datawizard/interfaces/test_interfaces.c

@@ -295,8 +295,10 @@ create_task(struct starpu_task **taskp, enum starpu_archtype type, int id)
 
 	if (n_cpus == -1) /* First time here */
 	{
-		/* XXX Dont check them all at once. */
-		/* XXX Error checking */
+		/* We do not check the return values of the calls to
+		 * starpu_worker_get_ids_by_type now, because it is simpler to
+		 * detect a problem in the switch that comes right after this 
+		 * block of code. */
 		n_cpus = starpu_worker_get_ids_by_type(STARPU_CPU_WORKER,
 							cpu_workers,
 							STARPU_MAXCPUS);

+ 5 - 1
tests/perfmodels/valid_model.c

@@ -34,11 +34,13 @@ static struct starpu_perfmodel nlrb_model =
 	.symbol = "valid_model_non_linear_regression_based"
 };
 
+#if 0
 static struct starpu_perfmodel hb_model =
 {
 	.type = STARPU_HISTORY_BASED,
 	.symbol = "valid_model_history_based"
 };
+#endif
 
 static struct starpu_codelet codelet =
 {
@@ -121,7 +123,9 @@ int main(int argc, char **argv)
 	ret = submit(&codelet, &nlrb_model);
 	if (ret) return ret;
 
-#warning history based model cannot be validated with regression.nsample
+#ifdef STARPU_DEVEL
+#  warning history based model cannot be validated with regression.nsample
+#endif
 #if 0
 	/* Use a history model */
 	ret = submit(&codelet, &hb_model);

+ 7 - 0
tools/Makefile.am

@@ -50,9 +50,16 @@ LOADER			=	loader
 loader_CPPFLAGS =  $(AM_CFLAGS) $(AM_CPPFLAGS) -I$(top_builddir)/src/
 LOADER_BIN		=	$(abs_top_builddir)/tools/$(LOADER)
 loader_SOURCES		=	../tests/loader.c
+
+if STARPU_HAVE_AM111
+TESTS_ENVIRONMENT	=	top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)"
+LOG_COMPILER		=	$(LOADER_BIN)
+else
 TESTS_ENVIRONMENT	=	top_builddir="$(abs_top_builddir)" top_srcdir="$(abs_top_srcdir)" $(LOADER_BIN)
 endif
 
+endif
+
 if STARPU_USE_FXT
 bin_PROGRAMS += 			\
 	starpu_fxt_tool			\

+ 2 - 2
tools/starpu_fxt_stats.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012  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
@@ -57,7 +57,7 @@ int main(int argc, char **argv)
 
 	if (argc < 2) {
 	        fprintf(stderr, "Usage : %s input_filename [-o output_filename]\n", argv[0]);
-	        exit(-1);
+	        exit(77);
 	}
 	
 	filename = argv[1];

+ 4 - 0
tools/starpu_fxt_tool.c

@@ -1,6 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012  Université de Bordeaux 1
+ * Copyright (C) 2012  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
@@ -84,6 +85,9 @@ int main(int argc, char **argv)
 {
 	parse_args(argc, argv);
 
+	if (options.ninputfiles == 0)
+	     return 77;
+
 	starpu_fxt_generate_trace(&options);
 
 	return 0;