Explorar o código

Rename the write-back mechanism into write-through mechanism.

Cédric Augonnet %!s(int64=15) %!d(string=hai) anos
pai
achega
3f9d1a9977

+ 1 - 1
examples/audio/starpu_audio_processing.c

@@ -402,7 +402,7 @@ int main(int argc, char **argv)
 	starpu_data_partition(A_handle, &f);
 
 	for (iter = 0; iter < niter; iter++)
-		starpu_data_set_wb_mask(starpu_data_get_sub_data(A_handle, 1, iter), 1<<0);
+		starpu_data_set_wt_mask(starpu_data_get_sub_data(A_handle, 1, iter), 1<<0);
 
 	gettimeofday(&start, NULL);
 

+ 1 - 1
examples/mult/dw_mult.c

@@ -160,7 +160,7 @@ static void partition_mult_data(void)
 	starpu_matrix_data_register(&C_handle, 0, (uintptr_t)C, 
 		ydim, ydim, xdim, sizeof(float));
 
-	starpu_data_set_wb_mask(C_handle, 1<<0);
+	starpu_data_set_wt_mask(C_handle, 1<<0);
 
 	conf.k = zdim;
 	conf.m = ydim/nslicesy;

+ 1 - 1
examples/mult/xgemm.c

@@ -144,7 +144,7 @@ static void partition_mult_data(void)
 	starpu_matrix_data_register(&C_handle, 0, (uintptr_t)C, 
 		ydim, ydim, xdim, sizeof(TYPE));
 
-	starpu_data_set_wb_mask(C_handle, 1<<0);
+	starpu_data_set_wt_mask(C_handle, 1<<0);
 
 	conf.k = zdim;
 	conf.m = ydim/nslicesy;

+ 2 - 2
examples/pi/pi.c

@@ -91,10 +91,10 @@ int main(int argc, char **argv)
 	starpu_data_handle cnt_array_handle;
 	starpu_vector_data_register(&cnt_array_handle, 0, (uintptr_t)cnt_array, ntasks, sizeof(unsigned));
 
-	/* Use a write-back policy : when the data is modified on an
+	/* Use a write-through policy : when the data is modified on an
 	 * accelerator, we know that it will only be modified once and be
 	 * accessed by the CPU later on */
-	starpu_data_set_wb_mask(cnt_array_handle, (1<<0));
+	starpu_data_set_wt_mask(cnt_array_handle, (1<<0));
 
 	struct starpu_data_filter f = {
 		.filter_func = starpu_block_filter_func_vector,

+ 2 - 2
examples/starpufft/starpufftx1d.c

@@ -531,7 +531,7 @@ STARPUFFT(plan_dft_1d)(int n, int sign, unsigned flags)
 		/* We'll need the result of fft1 on the CPU for the second
 		 * twist anyway, so tell starpu to not keep the fft1 buffer in
 		 * the GPU. */
-		starpu_data_set_wb_mask(plan->fft1_handle[z], 1<<0);
+		starpu_data_set_wt_mask(plan->fft1_handle[z], 1<<0);
 
 		/* Create twist1 task */
 		plan->twist1_tasks[z] = task = starpu_task_create();
@@ -597,7 +597,7 @@ STARPUFFT(plan_dft_1d)(int n, int sign, unsigned flags)
 		/* We'll need the result of fft2 on the CPU for the third
 		 * twist anyway, so tell starpu to not keep the fft2 buffer in
 		 * the GPU. */
-		starpu_data_set_wb_mask(plan->fft2_handle[z], 1<<0);
+		starpu_data_set_wt_mask(plan->fft2_handle[z], 1<<0);
 
 		/* Tell that twisted2 depends on the join task */
 		starpu_tag_declare_deps(STEP_TAG(TWIST2),

+ 2 - 2
examples/starpufft/starpufftx2d.c

@@ -520,7 +520,7 @@ STARPUFFT(plan_dft_2d)(int n, int m, int sign, unsigned flags)
 		starpu_vector_data_register(&plan->fft1_handle[z], 0, (uintptr_t) &plan->fft1[z*plan->totsize2], plan->totsize2, sizeof(*plan->fft1));
 
 		/* We'll need it on the CPU for the second twist anyway */
-		starpu_data_set_wb_mask(plan->fft1_handle[z], 1<<0);
+		starpu_data_set_wt_mask(plan->fft1_handle[z], 1<<0);
 
 		/* Create twist1 task */
 		plan->twist1_tasks[z] = task = starpu_task_create();
@@ -585,7 +585,7 @@ STARPUFFT(plan_dft_2d)(int n, int m, int sign, unsigned flags)
 		starpu_vector_data_register(&plan->fft2_handle[z], 0, (uintptr_t) &plan->fft2[z*plan->totsize4], plan->totsize4, sizeof(*plan->fft2));
 
 		/* We'll need it on the CPU for the last twist anyway */
-		starpu_data_set_wb_mask(plan->fft2_handle[z], 1<<0);
+		starpu_data_set_wt_mask(plan->fft2_handle[z], 1<<0);
 
 		/* Tell that twisted2 depends on the whole first step to be
 		 * done */

+ 2 - 2
include/starpu_data.h

@@ -67,9 +67,9 @@ unsigned starpu_worker_get_memory_node(unsigned workerid);
 
 /* 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
- * node. For instance a (1<<0) write-back mask means that the CUDA workers will
+ * node. For instance a (1<<0) write-through mask means that the CUDA workers will
  * commit their changes in main memory (node 0). */
-void starpu_data_set_wb_mask(starpu_data_handle handle, uint32_t wb_mask);
+void starpu_data_set_wt_mask(starpu_data_handle handle, uint32_t wt_mask);
 
 void starpu_data_set_sequential_consistency_flag(starpu_data_handle handle, unsigned flag);
 unsigned starpu_data_get_default_sequential_consistency_flag(void);

+ 5 - 6
src/datawizard/coherency.c

@@ -312,19 +312,18 @@ uint32_t _starpu_data_get_footprint(starpu_data_handle handle)
 
 /* in case the data was accessed on a write mode, do not forget to 
  * make it accessible again once it is possible ! */
-void _starpu_release_data_on_node(starpu_data_handle handle, uint32_t default_wb_mask, uint32_t memory_node)
+void _starpu_release_data_on_node(starpu_data_handle handle, uint32_t default_wt_mask, uint32_t memory_node)
 {
-	uint32_t wb_mask;
-	wb_mask = default_wb_mask | handle->wb_mask;
+	uint32_t wt_mask;
+	wt_mask = default_wt_mask | handle->wt_mask;
 
 	/* 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
 	 * not enforce any write-through mechanism. */
 
-	/* are we doing write-through or just some normal write-back ? */
 	if (handle->per_node[memory_node].state != STARPU_INVALID)
-	if ((wb_mask & ~(1<<memory_node)))
-		_starpu_write_through_data(handle, memory_node, wb_mask);
+	if ((wt_mask & ~(1<<memory_node)))
+		_starpu_write_through_data(handle, memory_node, wt_mask);
 
 	uint32_t local_node = _starpu_get_local_memory_node();
 	while (_starpu_spin_trylock(&handle->header_lock))

+ 3 - 3
src/datawizard/coherency.h

@@ -109,8 +109,8 @@ struct starpu_data_state_t {
 	/* where is the data home ? -1 if none yet */
 	int home_node;
 
-	/* what is the default write-back mask for that data ? */
-	uint32_t wb_mask;
+	/* what is the default write-through mask for that data ? */
+	uint32_t wt_mask;
 
 	/* allows special optimization */
 	uint8_t is_readonly;
@@ -155,7 +155,7 @@ void _starpu_display_msi_stats(void);
 int _starpu_fetch_data_on_node(struct starpu_data_state_t *state, uint32_t requesting_node,
 				starpu_access_mode mode, unsigned is_prefetch,
 				void (*callback_func)(void *), void *callback_arg);
-void _starpu_release_data_on_node(struct starpu_data_state_t *state, uint32_t default_wb_mask, unsigned memory_node);
+void _starpu_release_data_on_node(struct starpu_data_state_t *state, uint32_t default_wt_mask, unsigned memory_node);
 
 void _starpu_update_data_state(struct starpu_data_state_t *state, uint32_t requesting_node, starpu_access_mode mode);
 

+ 1 - 1
src/datawizard/filters.c

@@ -130,7 +130,7 @@ void starpu_data_partition(starpu_data_handle initial_handle, struct starpu_data
 		child->depth = initial_handle->depth + 1;
 
 		child->is_not_important = initial_handle->is_not_important;
-		child->wb_mask = initial_handle->wb_mask;
+		child->wt_mask = initial_handle->wt_mask;
 		child->home_node = initial_handle->home_node;
 
 		/* We compute the size and the footprint of the child once and

+ 2 - 2
src/datawizard/interfaces/data_interface.c

@@ -22,7 +22,7 @@
  */
 
 static void _starpu_register_new_data(starpu_data_handle handle,
-					uint32_t home_node, uint32_t wb_mask)
+					uint32_t home_node, uint32_t wt_mask)
 {
 	STARPU_ASSERT(handle);
 
@@ -59,7 +59,7 @@ static void _starpu_register_new_data(starpu_data_handle handle,
 	handle->last_submitted_ghost_readers_id = NULL;
 #endif
 
-	handle->wb_mask = wb_mask;
+	handle->wt_mask = wt_mask;
 
 	/* Store some values directly in the handle not to recompute them all
 	 * the time. */

+ 4 - 4
src/datawizard/write_back.c

@@ -61,15 +61,15 @@ void _starpu_write_through_data(starpu_data_handle handle, uint32_t requesting_n
 	_starpu_spin_unlock(&handle->header_lock);
 }
 
-void starpu_data_set_wb_mask(starpu_data_handle handle, uint32_t wb_mask)
+void starpu_data_set_wt_mask(starpu_data_handle handle, uint32_t wt_mask)
 {
-	handle->wb_mask = wb_mask;
+	handle->wt_mask = wt_mask;
 
-	/* in case the data has some children, set their wb_mask as well */
+	/* in case the data has some children, set their wt_mask as well */
 	if (handle->nchildren > 0) 
 	{
 		unsigned child;
 		for (child = 0; child < handle->nchildren; child++)
-			starpu_data_set_wb_mask(&handle->children[child], wb_mask);
+			starpu_data_set_wt_mask(&handle->children[child], wt_mask);
 	}
 }