浏览代码

Prefixing of src/core/dependencies/htable.h

find . -type f -not -name "*svn*"|xargs sed -i s/"\bhtbl_node_t\b"/starpu_htbl_node_t/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bhtbl_search_tag\b"/_starpu_htbl_search_tag/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bhtbl_insert_tag\b"/_starpu_htbl_insert_tag/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bhtbl_remove_tag\b"/_starpu_htbl_remove_tag/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bHTBL_NODE_SIZE\b"/STARPU_HTBL_NODE_SIZE/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\b_htbl_node_t\b"/starpu_htbl_node_s/g
Nathalie Furmento 15 年之前
父节点
当前提交
233ba49a49
共有 3 个文件被更改,包括 32 次插入32 次删除
  1. 21 21
      src/core/dependencies/htable.c
  2. 7 7
      src/core/dependencies/htable.h
  3. 4 4
      src/core/dependencies/tags.c

+ 21 - 21
src/core/dependencies/htable.c

@@ -17,15 +17,15 @@
 #include <core/dependencies/htable.h>
 #include <string.h>
 
-void *htbl_search_tag(htbl_node_t *htbl, starpu_tag_t tag)
+void *_starpu_htbl_search_tag(starpu_htbl_node_t *htbl, starpu_tag_t tag)
 {
 	unsigned currentbit;
-	htbl_node_t *current_htbl = htbl;
+	starpu_htbl_node_t *current_htbl = htbl;
 
-	/* 000000000001111 with HTBL_NODE_SIZE 1's */
-	starpu_tag_t mask = (1<<HTBL_NODE_SIZE)-1;
+	/* 000000000001111 with STARPU_HTBL_NODE_SIZE 1's */
+	starpu_tag_t mask = (1<<STARPU_HTBL_NODE_SIZE)-1;
 
-	for(currentbit = 0; currentbit < TAG_SIZE; currentbit+=HTBL_NODE_SIZE)
+	for(currentbit = 0; currentbit < TAG_SIZE; currentbit+=STARPU_HTBL_NODE_SIZE)
 	{
 	
 	//	printf("search : current bit = %d \n", currentbit);
@@ -39,7 +39,7 @@ void *htbl_search_tag(htbl_node_t *htbl, starpu_tag_t tag)
 		 * */
 
 		unsigned last_currentbit = 
-			TAG_SIZE - (currentbit + HTBL_NODE_SIZE);
+			TAG_SIZE - (currentbit + STARPU_HTBL_NODE_SIZE);
 		starpu_tag_t offloaded_mask = mask << last_currentbit;
 		unsigned current_index = 
 			(tag & (offloaded_mask)) >> (last_currentbit);
@@ -54,21 +54,21 @@ void *htbl_search_tag(htbl_node_t *htbl, starpu_tag_t tag)
  * returns the previous value of the tag, or NULL else
  */
 
-void *htbl_insert_tag(htbl_node_t **htbl, starpu_tag_t tag, void *entry)
+void *_starpu_htbl_insert_tag(starpu_htbl_node_t **htbl, starpu_tag_t tag, void *entry)
 {
 
 	unsigned currentbit;
-	htbl_node_t **current_htbl_ptr = htbl;
-	htbl_node_t *previous_htbl_ptr = NULL;
+	starpu_htbl_node_t **current_htbl_ptr = htbl;
+	starpu_htbl_node_t *previous_htbl_ptr = NULL;
 
-	/* 000000000001111 with HTBL_NODE_SIZE 1's */
-	starpu_tag_t mask = (1<<HTBL_NODE_SIZE)-1;
+	/* 000000000001111 with STARPU_HTBL_NODE_SIZE 1's */
+	starpu_tag_t mask = (1<<STARPU_HTBL_NODE_SIZE)-1;
 
-	for(currentbit = 0; currentbit < TAG_SIZE; currentbit+=HTBL_NODE_SIZE)
+	for(currentbit = 0; currentbit < TAG_SIZE; currentbit+=STARPU_HTBL_NODE_SIZE)
 	{
 		if (*current_htbl_ptr == NULL) {
 			/* TODO pad to change that 1 into 16 ? */
-			*current_htbl_ptr = calloc(1, sizeof(htbl_node_t));
+			*current_htbl_ptr = calloc(1, sizeof(starpu_htbl_node_t));
 			assert(*current_htbl_ptr);
 
 			if (previous_htbl_ptr)
@@ -82,7 +82,7 @@ void *htbl_insert_tag(htbl_node_t **htbl, starpu_tag_t tag, void *entry)
 		 * */
 
 		unsigned last_currentbit = 
-			TAG_SIZE - (currentbit + HTBL_NODE_SIZE);
+			TAG_SIZE - (currentbit + STARPU_HTBL_NODE_SIZE);
 		starpu_tag_t offloaded_mask = mask << last_currentbit;
 		unsigned current_index = 
 			(tag & (offloaded_mask)) >> (last_currentbit);
@@ -105,21 +105,21 @@ void *htbl_insert_tag(htbl_node_t **htbl, starpu_tag_t tag, void *entry)
 }
 
 /* returns the entry corresponding to the tag and remove it from the htbl */
-void *htbl_remove_tag(htbl_node_t *htbl, starpu_tag_t tag)
+void *_starpu_htbl_remove_tag(starpu_htbl_node_t *htbl, starpu_tag_t tag)
 {
 	/* NB : if the entry is "NULL", we assume this means it is not present XXX */
 	unsigned currentbit;
-	htbl_node_t *current_htbl_ptr = htbl;
+	starpu_htbl_node_t *current_htbl_ptr = htbl;
 
 	/* remember the path to the tag */
-	htbl_node_t *path[(TAG_SIZE + HTBL_NODE_SIZE - 1)/(HTBL_NODE_SIZE)];
+	starpu_htbl_node_t *path[(TAG_SIZE + STARPU_HTBL_NODE_SIZE - 1)/(STARPU_HTBL_NODE_SIZE)];
 
-	/* 000000000001111 with HTBL_NODE_SIZE 1's */
-	starpu_tag_t mask = (1<<HTBL_NODE_SIZE)-1;
+	/* 000000000001111 with STARPU_HTBL_NODE_SIZE 1's */
+	starpu_tag_t mask = (1<<STARPU_HTBL_NODE_SIZE)-1;
 	int level, maxlevel;
 	unsigned tag_is_present = 1;
 
-	for(currentbit = 0, level = 0; currentbit < TAG_SIZE; currentbit+=HTBL_NODE_SIZE, level++)
+	for(currentbit = 0, level = 0; currentbit < TAG_SIZE; currentbit+=STARPU_HTBL_NODE_SIZE, level++)
 	{
 		path[level] = current_htbl_ptr;
 
@@ -135,7 +135,7 @@ void *htbl_remove_tag(htbl_node_t *htbl, starpu_tag_t tag)
 		 * */
 
 		unsigned last_currentbit = 
-			TAG_SIZE - (currentbit + HTBL_NODE_SIZE);
+			TAG_SIZE - (currentbit + STARPU_HTBL_NODE_SIZE);
 		starpu_tag_t offloaded_mask = mask << last_currentbit;
 		unsigned current_index = 
 			(tag & (offloaded_mask)) >> (last_currentbit);

+ 7 - 7
src/core/dependencies/htable.h

@@ -27,16 +27,16 @@
 #include <assert.h>
 #include <core/dependencies/tags.h>
 
-#define HTBL_NODE_SIZE	16
+#define STARPU_HTBL_NODE_SIZE	16
 
-typedef struct _htbl_node_t {
+typedef struct starpu_htbl_node_s {
 	unsigned nentries;
-	struct _htbl_node_t *children[1<<HTBL_NODE_SIZE];
-} htbl_node_t;
+	struct starpu_htbl_node_s *children[1<<STARPU_HTBL_NODE_SIZE];
+} starpu_htbl_node_t;
 
-void *htbl_search_tag(htbl_node_t *htbl, starpu_tag_t tag);
-void *htbl_insert_tag(htbl_node_t **htbl, starpu_tag_t tag, void *entry);
-void *htbl_remove_tag(htbl_node_t *htbl, starpu_tag_t tag);
+void *_starpu_htbl_search_tag(starpu_htbl_node_t *htbl, starpu_tag_t tag);
+void *_starpu_htbl_insert_tag(starpu_htbl_node_t **htbl, starpu_tag_t tag, void *entry);
+void *_starpu_htbl_remove_tag(starpu_htbl_node_t *htbl, starpu_tag_t tag);
 
 
 #endif

+ 4 - 4
src/core/dependencies/tags.c

@@ -22,7 +22,7 @@
 #include <core/policies/sched_policy.h>
 #include <core/dependencies/data-concurrency.h>
 
-static htbl_node_t *tag_htbl = NULL;
+static starpu_htbl_node_t *tag_htbl = NULL;
 static pthread_rwlock_t tag_global_rwlock = PTHREAD_RWLOCK_INITIALIZER;
 
 static starpu_cg_t *create_cg_apps(unsigned ntags)
@@ -83,7 +83,7 @@ void starpu_tag_remove(starpu_tag_t id)
 
 	pthread_rwlock_wrlock(&tag_global_rwlock);
 
-	tag = htbl_remove_tag(tag_htbl, id);
+	tag = _starpu_htbl_remove_tag(tag_htbl, id);
 
 	pthread_rwlock_unlock(&tag_global_rwlock);
 
@@ -121,14 +121,14 @@ static struct tag_s *gettag_struct(starpu_tag_t id)
 
 	/* search if the tag is already declared or not */
 	struct tag_s *tag;
-	tag = htbl_search_tag(tag_htbl, id);
+	tag = _starpu_htbl_search_tag(tag_htbl, id);
 
 	if (tag == NULL) {
 		/* the tag does not exist yet : create an entry */
 		tag = _starpu_tag_init(id);
 
 		void *old;
-		old = htbl_insert_tag(&tag_htbl, id, tag);
+		old = _starpu_htbl_insert_tag(&tag_htbl, id, tag);
 		/* there was no such tag before */
 		STARPU_ASSERT(old == NULL);
 	}