Sfoglia il codice sorgente

Make sure that all static inlines are indeed inlined

Samuel Thibault 8 anni fa
parent
commit
cbe6f98e73
3 ha cambiato i file con 16 aggiunte e 4 eliminazioni
  1. 13 1
      src/Makefile.am
  2. 1 2
      src/common/rbtree.h
  3. 2 1
      src/util/starpu_data_cpy.c

+ 13 - 1
src/Makefile.am

@@ -1,6 +1,6 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
-# Copyright (C) 2009-2016  Université de Bordeaux
+# Copyright (C) 2009-2017  Université de Bordeaux
 # Copyright (C) 2010, 2011, 2012, 2013, 2015  CNRS
 # Copyright (C) 2011, 2014  INRIA
 # Copyright (C) 2016  Inria
@@ -385,5 +385,17 @@ endif
 
 #########################################
 
+# If some external references appear (U), it means the corresponding .c file has
+# only included <starpu.h> and not the internal src/ header which contains the
+# static inline definition
+dist-hook:
+	failed=0 ; \
+	for i in $$( grep "static inline" $$(find $(srcdir) -name \*.h) | sed -e 's/.*static inline //g' | grep -v ENAME | sed -e 's/[^(]* \(\|\*\)\([^ (]*\)(.*/\2/' ) ; do \
+		for j in .libs/*.o ; do \
+			nm $$j | grep "U $$i" && { echo $$j ; failed=1 ; } ; \
+		done ; \
+	done ; \
+	[ $$failed == 0 ]
+
 showcheck:
 	-cat /dev/null

+ 1 - 2
src/common/rbtree.h

@@ -250,8 +250,7 @@ MACRO_END
  * must not compare equal to an existing node in the tree (i.e. the slot
  * must denote a null node).
  */
-static inline void
-starpu_rbtree_insert_slot(struct starpu_rbtree *tree, unsigned long slot,
+static inline void starpu_rbtree_insert_slot(struct starpu_rbtree *tree, unsigned long slot,
                    struct starpu_rbtree_node *node)
 {
     struct starpu_rbtree_node *parent;

+ 2 - 1
src/util/starpu_data_cpy.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2012-2013, 2015-2016  Université de Bordeaux
+ * Copyright (C) 2010, 2012-2013, 2015-2017  Université de Bordeaux
  *
  * 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
@@ -17,6 +17,7 @@
 #include <starpu.h>
 #include <common/config.h>
 #include <core/task.h>
+#include <core/workers.h>
 #include <datawizard/datawizard.h>
 #include <util/starpu_data_cpy.h>
 #include <starpu_mic.h>