浏览代码

Implement starpu_get_vector_elemsize that was somehow missing.

Cédric Augonnet 15 年之前
父节点
当前提交
5763bd2d0c
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 1 0
      include/starpu-data-interfaces.h
  2. 5 0
      src/datawizard/interfaces/vector_interface.c

+ 1 - 0
include/starpu-data-interfaces.h

@@ -74,6 +74,7 @@ typedef struct starpu_vector_interface_s {
 void starpu_register_vector_data(starpu_data_handle *handle, uint32_t home_node,
 void starpu_register_vector_data(starpu_data_handle *handle, uint32_t home_node,
                         uintptr_t ptr, uint32_t nx, size_t elemsize);
                         uintptr_t ptr, uint32_t nx, size_t elemsize);
 uint32_t starpu_get_vector_nx(starpu_data_handle handle);
 uint32_t starpu_get_vector_nx(starpu_data_handle handle);
+size_t starpu_get_vector_elemsize(starpu_data_handle handle);
 uintptr_t starpu_get_vector_local_ptr(starpu_data_handle handle);
 uintptr_t starpu_get_vector_local_ptr(starpu_data_handle handle);
 
 
 /* CSR interface for sparse matrices (compressed sparse row representation) */
 /* CSR interface for sparse matrices (compressed sparse row representation) */

+ 5 - 0
src/datawizard/interfaces/vector_interface.c

@@ -188,6 +188,11 @@ uintptr_t starpu_get_vector_local_ptr(data_state *state)
 	return (state->interface[node].vector.ptr);
 	return (state->interface[node].vector.ptr);
 }
 }
 
 
+size_t starpu_get_vector_elemsize(data_state *state)
+{
+	return (state->interface[0].vector.elemsize);
+}
+
 /* memory allocation/deallocation primitives for the vector interface */
 /* memory allocation/deallocation primitives for the vector interface */
 
 
 /* returns the size of the allocated area */
 /* returns the size of the allocated area */