|
@@ -1,7 +1,7 @@
|
|
|
/* StarPU --- Runtime system for heterogeneous multicore architectures.
|
|
|
*
|
|
|
* Copyright (C) 2010-2016 Université de Bordeaux
|
|
|
- * Copyright (C) 2010-2014 CNRS
|
|
|
+ * Copyright (C) 2010-2014, 2017 CNRS
|
|
|
* Copyright (C) 2011-2012, 2016 INRIA
|
|
|
*
|
|
|
* StarPU is free software; you can redistribute it and/or modify
|
|
@@ -173,13 +173,23 @@ uint32_t starpu_matrix_get_local_ld(starpu_data_handle_t handle);
|
|
|
uintptr_t starpu_matrix_get_local_ptr(starpu_data_handle_t handle);
|
|
|
size_t starpu_matrix_get_elemsize(starpu_data_handle_t handle);
|
|
|
|
|
|
+#if defined(STARPU_HAVE_STATEMENT_EXPRESSIONS) && defined(STARPU_DEBUG)
|
|
|
+#define STARPU_MATRIX_GET_PTR(interface) ({ assert((((struct starpu_matrix_interface *)(interface))->id) == STARPU_MATRIX_INTERFACE_ID) ; (((struct starpu_matrix_interface *)(interface))->ptr) ; })
|
|
|
+#define STARPU_MATRIX_GET_DEV_HANDLE(interface) ({ assert((((struct starpu_matrix_interface *)(interface))->id) == STARPU_MATRIX_INTERFACE_ID) ; (((struct starpu_matrix_interface *)(interface))->dev_handle) ; })
|
|
|
+#define STARPU_MATRIX_GET_OFFSET(interface) ({ assert((((struct starpu_matrix_interface *)(interface))->id) == STARPU_MATRIX_INTERFACE_ID) ; (((struct starpu_matrix_interface *)(interface))->offset) ; })
|
|
|
+#define STARPU_MATRIX_GET_NX(interface) ({ assert((((struct starpu_matrix_interface *)(interface))->id) == STARPU_MATRIX_INTERFACE_ID) ; (((struct starpu_matrix_interface *)(interface))->nx) ; })
|
|
|
+#define STARPU_MATRIX_GET_NY(interface) ({ assert((((struct starpu_matrix_interface *)(interface))->id) == STARPU_MATRIX_INTERFACE_ID) ; (((struct starpu_matrix_interface *)(interface))->ny) ; })
|
|
|
+#define STARPU_MATRIX_GET_LD(interface) ({ assert((((struct starpu_matrix_interface *)(interface))->id) == STARPU_MATRIX_INTERFACE_ID) ; (((struct starpu_matrix_interface *)(interface))->ld) ; })
|
|
|
+#define STARPU_MATRIX_GET_ELEMSIZE(interface) ({ assert((((struct starpu_matrix_interface *)(interface))->id) == STARPU_MATRIX_INTERFACE_ID) ; (((struct starpu_matrix_interface *)(interface))->elemsize) ; })
|
|
|
+#else
|
|
|
#define STARPU_MATRIX_GET_PTR(interface) (((struct starpu_matrix_interface *)(interface))->ptr)
|
|
|
#define STARPU_MATRIX_GET_DEV_HANDLE(interface) (((struct starpu_matrix_interface *)(interface))->dev_handle)
|
|
|
#define STARPU_MATRIX_GET_OFFSET(interface) (((struct starpu_matrix_interface *)(interface))->offset)
|
|
|
-#define STARPU_MATRIX_GET_NX(interface) (((struct starpu_matrix_interface *)(interface))->nx)
|
|
|
-#define STARPU_MATRIX_GET_NY(interface) (((struct starpu_matrix_interface *)(interface))->ny)
|
|
|
-#define STARPU_MATRIX_GET_LD(interface) (((struct starpu_matrix_interface *)(interface))->ld)
|
|
|
+#define STARPU_MATRIX_GET_NX(interface) (((struct starpu_matrix_interface *)(interface))->nx)
|
|
|
+#define STARPU_MATRIX_GET_NY(interface) (((struct starpu_matrix_interface *)(interface))->ny)
|
|
|
+#define STARPU_MATRIX_GET_LD(interface) (((struct starpu_matrix_interface *)(interface))->ld)
|
|
|
#define STARPU_MATRIX_GET_ELEMSIZE(interface) (((struct starpu_matrix_interface *)(interface))->elemsize)
|
|
|
+#endif
|
|
|
|
|
|
extern struct starpu_data_interface_ops starpu_interface_coo_ops;
|
|
|
|
|
@@ -248,15 +258,27 @@ uint32_t starpu_block_get_local_ldz(starpu_data_handle_t handle);
|
|
|
uintptr_t starpu_block_get_local_ptr(starpu_data_handle_t handle);
|
|
|
size_t starpu_block_get_elemsize(starpu_data_handle_t handle);
|
|
|
|
|
|
-#define STARPU_BLOCK_GET_PTR(interface) (((struct starpu_block_interface *)(interface))->ptr)
|
|
|
+#if defined(STARPU_HAVE_STATEMENT_EXPRESSIONS) && defined(STARPU_DEBUG)
|
|
|
+#define STARPU_BLOCK_GET_PTR(interface) ({ assert((((struct starpu_block_interface *)(interface))->id) == STARPU_BLOCK_INTERFACE_ID) ; (((struct starpu_block_interface *)(interface))->ptr) ; })
|
|
|
+#define STARPU_BLOCK_GET_DEV_HANDLE(interface) ({ assert((((struct starpu_block_interface *)(interface))->id) == STARPU_BLOCK_INTERFACE_ID) ; (((struct starpu_block_interface *)(interface))->dev_handle) ; })
|
|
|
+#define STARPU_BLOCK_GET_OFFSET(interface) ({ assert((((struct starpu_block_interface *)(interface))->id) == STARPU_BLOCK_INTERFACE_ID) ; (((struct starpu_block_interface *)(interface))->offset) ; })
|
|
|
+#define STARPU_BLOCK_GET_NX(interface) ({ assert((((struct starpu_block_interface *)(interface))->id) == STARPU_BLOCK_INTERFACE_ID) ; (((struct starpu_block_interface *)(interface))->nx) ; })
|
|
|
+#define STARPU_BLOCK_GET_NY(interface) ({ assert((((struct starpu_block_interface *)(interface))->id) == STARPU_BLOCK_INTERFACE_ID) ; (((struct starpu_block_interface *)(interface))->ny) ; })
|
|
|
+#define STARPU_BLOCK_GET_NZ(interface) ({ assert((((struct starpu_block_interface *)(interface))->id) == STARPU_BLOCK_INTERFACE_ID) ; (((struct starpu_block_interface *)(interface))->nz) ; })
|
|
|
+#define STARPU_BLOCK_GET_LDY(interface) ({ assert((((struct starpu_block_interface *)(interface))->id) == STARPU_BLOCK_INTERFACE_ID) ; (((struct starpu_block_interface *)(interface))->ldy) ; })
|
|
|
+#define STARPU_BLOCK_GET_LDZ(interface) ({ assert((((struct starpu_block_interface *)(interface))->id) == STARPU_BLOCK_INTERFACE_ID) ; (((struct starpu_block_interface *)(interface))->ldz) ; })
|
|
|
+#define STARPU_BLOCK_GET_ELEMSIZE(interface) ({ assert((((struct starpu_block_interface *)(interface))->id) == STARPU_BLOCK_INTERFACE_ID) ; (((struct starpu_block_interface *)(interface))->elemsize) ; })
|
|
|
+#else
|
|
|
+#define STARPU_BLOCK_GET_PTR(interface) (((struct starpu_block_interface *)(interface))->ptr)
|
|
|
#define STARPU_BLOCK_GET_DEV_HANDLE(interface) (((struct starpu_block_interface *)(interface))->dev_handle)
|
|
|
#define STARPU_BLOCK_GET_OFFSET(interface) (((struct starpu_block_interface *)(interface))->offset)
|
|
|
-#define STARPU_BLOCK_GET_NX(interface) (((struct starpu_block_interface *)(interface))->nx)
|
|
|
-#define STARPU_BLOCK_GET_NY(interface) (((struct starpu_block_interface *)(interface))->ny)
|
|
|
-#define STARPU_BLOCK_GET_NZ(interface) (((struct starpu_block_interface *)(interface))->nz)
|
|
|
-#define STARPU_BLOCK_GET_LDY(interface) (((struct starpu_block_interface *)(interface))->ldy)
|
|
|
-#define STARPU_BLOCK_GET_LDZ(interface) (((struct starpu_block_interface *)(interface))->ldz)
|
|
|
+#define STARPU_BLOCK_GET_NX(interface) (((struct starpu_block_interface *)(interface))->nx)
|
|
|
+#define STARPU_BLOCK_GET_NY(interface) (((struct starpu_block_interface *)(interface))->ny)
|
|
|
+#define STARPU_BLOCK_GET_NZ(interface) (((struct starpu_block_interface *)(interface))->nz)
|
|
|
+#define STARPU_BLOCK_GET_LDY(interface) (((struct starpu_block_interface *)(interface))->ldy)
|
|
|
+#define STARPU_BLOCK_GET_LDZ(interface) (((struct starpu_block_interface *)(interface))->ldz)
|
|
|
#define STARPU_BLOCK_GET_ELEMSIZE(interface) (((struct starpu_block_interface *)(interface))->elemsize)
|
|
|
+#endif
|
|
|
|
|
|
extern struct starpu_data_interface_ops starpu_interface_vector_ops;
|
|
|
|
|
@@ -279,12 +301,21 @@ uint32_t starpu_vector_get_nx(starpu_data_handle_t handle);
|
|
|
size_t starpu_vector_get_elemsize(starpu_data_handle_t handle);
|
|
|
uintptr_t starpu_vector_get_local_ptr(starpu_data_handle_t handle);
|
|
|
|
|
|
+#if defined(STARPU_HAVE_STATEMENT_EXPRESSIONS) && defined(STARPU_DEBUG)
|
|
|
+#define STARPU_VECTOR_GET_PTR(interface) ({ assert((((struct starpu_vector_interface *)(interface))->id) == STARPU_VECTOR_INTERFACE_ID) ; (((struct starpu_vector_interface *)(interface))->ptr); })
|
|
|
+#define STARPU_VECTOR_GET_DEV_HANDLE(interface) ({ assert((((struct starpu_vector_interface *)(interface))->id) == STARPU_VECTOR_INTERFACE_ID) ; (((struct starpu_vector_interface *)(interface))->dev_handle); })
|
|
|
+#define STARPU_VECTOR_GET_OFFSET(interface) ({ assert((((struct starpu_vector_interface *)(interface))->id) == STARPU_VECTOR_INTERFACE_ID) ; (((struct starpu_vector_interface *)(interface))->offset); })
|
|
|
+#define STARPU_VECTOR_GET_NX(interface) ({ assert((((struct starpu_vector_interface *)(interface))->id) == STARPU_VECTOR_INTERFACE_ID) ; (((struct starpu_vector_interface *)(interface))->nx); })
|
|
|
+#define STARPU_VECTOR_GET_ELEMSIZE(interface) ({ assert((((struct starpu_vector_interface *)(interface))->id) == STARPU_VECTOR_INTERFACE_ID) ; (((struct starpu_vector_interface *)(interface))->elemsize); })
|
|
|
+#define STARPU_VECTOR_GET_SLICE_BASE(interface) ({ assert((((struct starpu_vector_interface *)(interface))->id) == STARPU_VECTOR_INTERFACE_ID) ; (((struct starpu_vector_interface *)(interface))->slice_base); })
|
|
|
+#else
|
|
|
#define STARPU_VECTOR_GET_PTR(interface) (((struct starpu_vector_interface *)(interface))->ptr)
|
|
|
#define STARPU_VECTOR_GET_DEV_HANDLE(interface) (((struct starpu_vector_interface *)(interface))->dev_handle)
|
|
|
#define STARPU_VECTOR_GET_OFFSET(interface) (((struct starpu_vector_interface *)(interface))->offset)
|
|
|
-#define STARPU_VECTOR_GET_NX(interface) (((struct starpu_vector_interface *)(interface))->nx)
|
|
|
+#define STARPU_VECTOR_GET_NX(interface) (((struct starpu_vector_interface *)(interface))->nx)
|
|
|
#define STARPU_VECTOR_GET_ELEMSIZE(interface) (((struct starpu_vector_interface *)(interface))->elemsize)
|
|
|
#define STARPU_VECTOR_GET_SLICE_BASE(interface) (((struct starpu_vector_interface *)(interface))->slice_base)
|
|
|
+#endif
|
|
|
|
|
|
extern struct starpu_data_interface_ops starpu_interface_variable_ops;
|
|
|
|
|
@@ -303,11 +334,17 @@ void starpu_variable_ptr_register(starpu_data_handle_t handle, unsigned node, ui
|
|
|
size_t starpu_variable_get_elemsize(starpu_data_handle_t handle);
|
|
|
uintptr_t starpu_variable_get_local_ptr(starpu_data_handle_t handle);
|
|
|
|
|
|
-#define STARPU_VARIABLE_GET_PTR(interface) (((struct starpu_variable_interface *)(interface))->ptr)
|
|
|
-#define STARPU_VARIABLE_GET_OFFSET(interface) (((struct starpu_variable_interface *)(interface))->offset)
|
|
|
-#define STARPU_VARIABLE_GET_ELEMSIZE(interface) (((struct starpu_variable_interface *)(interface))->elemsize)
|
|
|
-#define STARPU_VARIABLE_GET_DEV_HANDLE(interface) \
|
|
|
- (((struct starpu_variable_interface *)(interface))->ptr)
|
|
|
+#if defined(STARPU_HAVE_STATEMENT_EXPRESSIONS) && defined(STARPU_DEBUG)
|
|
|
+#define STARPU_VARIABLE_GET_PTR(interface) ({ assert((((struct starpu_variable_interface *)(interface))->id) == STARPU_VARIABLE_INTERFACE_ID) ; (((struct starpu_variable_interface *)(interface))->ptr) ; })
|
|
|
+#define STARPU_VARIABLE_GET_OFFSET(interface) ({ assert((((struct starpu_variable_interface *)(interface))->id) == STARPU_VARIABLE_INTERFACE_ID) ; (((struct starpu_variable_interface *)(interface))->offset) ; })
|
|
|
+#define STARPU_VARIABLE_GET_ELEMSIZE(interface) ({ assert((((struct starpu_variable_interface *)(interface))->id) == STARPU_VARIABLE_INTERFACE_ID) ; (((struct starpu_variable_interface *)(interface))->elemsize) ; })
|
|
|
+#define STARPU_VARIABLE_GET_DEV_HANDLE(interface) ({ assert((((struct starpu_variable_interface *)(interface))->id) == STARPU_VARIABLE_INTERFACE_ID) ; (((struct starpu_variable_interface *)(interface))->ptr) ; })
|
|
|
+#else
|
|
|
+#define STARPU_VARIABLE_GET_PTR(interface) (((struct starpu_variable_interface *)(interface))->ptr)
|
|
|
+#define STARPU_VARIABLE_GET_OFFSET(interface) (((struct starpu_variable_interface *)(interface))->offset)
|
|
|
+#define STARPU_VARIABLE_GET_ELEMSIZE(interface) (((struct starpu_variable_interface *)(interface))->elemsize)
|
|
|
+#define STARPU_VARIABLE_GET_DEV_HANDLE(interface) (((struct starpu_variable_interface *)(interface))->ptr)
|
|
|
+#endif
|
|
|
|
|
|
extern struct starpu_data_interface_ops starpu_interface_void_ops;
|
|
|
|