Bladeren bron

- avoid accessing StarPU's own data structures directly in the OpenMP layer

Olivier Aumage 8 jaren geleden
bovenliggende
commit
80bb8e2b10

+ 2 - 0
include/starpu_data_interfaces.h

@@ -432,6 +432,8 @@ size_t starpu_data_get_size(starpu_data_handle_t handle);
 
 starpu_data_handle_t starpu_data_lookup(const void *ptr);
 
+int starpu_data_get_home_node(starpu_data_handle_t handle);
+
 #ifdef __cplusplus
 }
 #endif

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

@@ -1061,3 +1061,9 @@ size_t starpu_data_get_size(starpu_data_handle_t handle)
 {
 	return handle->ops->get_size(handle);
 }
+
+int starpu_data_get_home_node(starpu_data_handle_t handle)
+{
+	return handle->home_node;
+}
+

+ 1 - 1
src/util/openmp_runtime_support.c

@@ -2419,7 +2419,7 @@ void starpu_omp_atomic_fallback_inline_end(void)
 void starpu_omp_vector_annotate(starpu_data_handle_t handle, uint32_t slice_base)
 {
 	/* FIXME Oli: rather iterate over all nodes? */
-	int node = handle->home_node;
+	int node = starpu_data_get_home_node(handle);
 	if (node < 0 || (starpu_node_get_kind(node) != STARPU_CPU_RAM))
 		node = STARPU_MAIN_RAM;
 	struct starpu_vector_interface *vector_interface = (struct starpu_vector_interface *)