瀏覽代碼

Make _starpu_get_memory_nodes_count() public.

It becomes starpu_get_memory_nodes_count().
Cyril Roelandt 13 年之前
父節點
當前提交
6b9290d36c
共有 5 個文件被更改,包括 7 次插入7 次删除
  1. 1 0
      include/starpu_data.h
  2. 4 4
      src/datawizard/coherency.c
  3. 1 1
      src/datawizard/memory_nodes.c
  4. 0 1
      src/datawizard/memory_nodes.h
  5. 1 1
      src/datawizard/write_back.c

+ 1 - 0
include/starpu_data.h

@@ -89,6 +89,7 @@ int starpu_data_request_allocation(starpu_data_handle_t handle, uint32_t node);
 int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
 
 unsigned starpu_worker_get_memory_node(unsigned workerid);
+unsigned starpu_get_memory_nodes_count(void);
 
 /* It is possible to associate a mask to a piece of data (and its children) so
  * that when it is modified, it is automatically transfered into those memory

+ 4 - 4
src/datawizard/coherency.c

@@ -29,7 +29,7 @@ uint32_t _starpu_select_src_node(starpu_data_handle_t handle, unsigned destinati
 	int src_node = -1;
 	unsigned i;
 
-	unsigned nnodes = _starpu_get_memory_nodes_count();
+	unsigned nnodes = starpu_get_memory_nodes_count();
 
 	/* first find a valid copy, either a STARPU_OWNER or a STARPU_SHARED */
 	uint32_t node;
@@ -121,7 +121,7 @@ void _starpu_update_data_state(starpu_data_handle_t handle,
 	if (!(mode & STARPU_RW))
 		return;
 
-	unsigned nnodes = _starpu_get_memory_nodes_count();
+	unsigned nnodes = starpu_get_memory_nodes_count();
 
 	/* the data is present now */
 	unsigned requesting_node = requesting_replicate->memory_node;
@@ -525,7 +525,7 @@ void _starpu_release_data_on_node(starpu_data_handle_t handle, uint32_t default_
 {
 	uint32_t wt_mask;
 	wt_mask = default_wt_mask | handle->wt_mask;
-	wt_mask &= (1<<_starpu_get_memory_nodes_count())-1;
+	wt_mask &= (1<<starpu_get_memory_nodes_count())-1;
 
 	/* Note that it is possible that there is no valid copy of the data (if
 	 * starpu_data_invalidate was called for instance). In that case, we do
@@ -742,7 +742,7 @@ unsigned _starpu_is_data_present_or_requested(starpu_data_handle_t handle, uint3
 	else
 	{
 		unsigned i;
-		unsigned nnodes = _starpu_get_memory_nodes_count();
+		unsigned nnodes = starpu_get_memory_nodes_count();
 
 		for (i = 0; i < nnodes; i++)
 		{

+ 1 - 1
src/datawizard/memory_nodes.c

@@ -99,7 +99,7 @@ int _starpu_memory_node_to_devid(unsigned node)
 	return descr.devid[node];
 }
 
-unsigned _starpu_get_memory_nodes_count(void)
+unsigned starpu_get_memory_nodes_count(void)
 {
 	return descr.nnodes;
 }

+ 0 - 1
src/datawizard/memory_nodes.h

@@ -79,7 +79,6 @@ void _starpu_memory_node_register_condition(pthread_cond_t *cond, pthread_mutex_
 
 enum _starpu_node_kind _starpu_get_node_kind(uint32_t node);
 int _starpu_memory_node_to_devid(unsigned node);
-unsigned _starpu_get_memory_nodes_count(void);
 
 struct _starpu_mem_node_descr *_starpu_get_memory_node_description(void);
 

+ 1 - 1
src/datawizard/write_back.c

@@ -39,7 +39,7 @@ void _starpu_write_through_data(starpu_data_handle_t handle, uint32_t requesting
 
 	/* first commit all changes onto the nodes specified by the mask */
 	uint32_t node;
-	for (node = 0; node < _starpu_get_memory_nodes_count(); node++)
+	for (node = 0; node < starpu_get_memory_nodes_count(); node++)
 	{
 		if (write_through_mask & (1<<node))
 		{