StarPU Handbook

starpu_data_interfaces.h
Go to the documentation of this file.
1/* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2009-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4 *
5 * StarPU is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; either version 2.1 of the License, or (at
8 * your option) any later version.
9 *
10 * StarPU is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *
14 * See the GNU Lesser General Public License in COPYING.LGPL for more details.
15 */
16
17#ifndef __STARPU_DATA_INTERFACES_H__
18#define __STARPU_DATA_INTERFACES_H__
19
20#include <starpu.h>
21
22#ifdef STARPU_USE_CUDA
23/* to use CUDA streams */
24# ifdef STARPU_DONT_INCLUDE_CUDA_HEADERS
25 typedef void *starpu_cudaStream_t;
26# else
27# include <cuda_runtime.h>
28 typedef cudaStream_t starpu_cudaStream_t;
29# endif
30#endif
31
32#ifdef __cplusplus
33 extern "C"
34{
35#endif
36
92 struct starpu_data_copy_methods
93{
101 int (*can_copy)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, unsigned handling_node);
102
108 int (*ram_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
109
115 int (*ram_to_cuda)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
116
122 int (*ram_to_opencl)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
123
129 int (*ram_to_mic)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
130
136 int (*cuda_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
137
143 int (*cuda_to_cuda)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
144
150 int (*cuda_to_opencl)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
151
157 int (*opencl_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
158
164 int (*opencl_to_cuda)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
165
171 int (*opencl_to_opencl)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
172
178 int (*mic_to_ram)(void *src_interface, unsigned srd_node, void *dst_interface, unsigned dst_node);
179
185 int (*ram_to_mpi_ms)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
186
192 int (*mpi_ms_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
193
199 int (*mpi_ms_to_mpi_ms)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
200
201#ifdef STARPU_USE_CUDA
210 int (*ram_to_cuda_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream);
211
220 int (*cuda_to_ram_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream);
221
230 int (*cuda_to_cuda_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream);
231#else
232 int (*ram_to_cuda_async)();
233 int (*cuda_to_ram_async)();
234 int (*cuda_to_cuda_async)();
235#endif
236
237#if defined(STARPU_USE_OPENCL) && !defined(__CUDACC__)
247 int (*ram_to_opencl_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event);
257 int (*opencl_to_ram_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event);
267 int (*opencl_to_opencl_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event);
268#else
269 int (*ram_to_opencl_async)();
270 int (*opencl_to_ram_async)();
271 int (*opencl_to_opencl_async)();
272#endif
273
282 int (*ram_to_mpi_ms_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void * event);
283
292 int (*mpi_ms_to_ram_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void * event);
293
302 int (*mpi_ms_to_mpi_ms_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void * event);
303
312 int (*ram_to_mic_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node);
313
322 int (*mic_to_ram_async)(void *src_interface, unsigned srd_node, void *dst_interface, unsigned dst_node);
323
341 int (*any_to_any)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *async_data);
342};
343
347 enum starpu_data_interface_id
348{
349 STARPU_UNKNOWN_INTERFACE_ID = -1,
350 STARPU_MATRIX_INTERFACE_ID=0,
351 STARPU_BLOCK_INTERFACE_ID=1,
352 STARPU_VECTOR_INTERFACE_ID=2,
353 STARPU_CSR_INTERFACE_ID=3,
354 STARPU_BCSR_INTERFACE_ID=4,
355 STARPU_VARIABLE_INTERFACE_ID=5,
356 STARPU_VOID_INTERFACE_ID=6,
357 STARPU_MULTIFORMAT_INTERFACE_ID=7,
358 STARPU_COO_INTERFACE_ID=8,
359 STARPU_MAX_INTERFACE_ID=9
360};
361
365 struct starpu_data_interface_ops
366{
378 void (*register_data_handle) (starpu_data_handle_t handle, unsigned home_node, void *data_interface);
379
389 void (*unregister_data_handle) (starpu_data_handle_t handle);
390
404 starpu_ssize_t (*allocate_data_on_node) (void *data_interface, unsigned node);
405
411 void (*free_data_on_node) (void *data_interface, unsigned node);
412
418 void (*init) (void *data_interface);
419
428 const struct starpu_data_copy_methods *copy_methods;
429
438 void * (*handle_to_pointer) (starpu_data_handle_t handle, unsigned node);
439
446 void * (*to_pointer) (void *data_interface, unsigned node);
447
452 int (*pointer_is_inside) (void *data_interface, unsigned node, void *ptr);
453
457 size_t (*get_size) (starpu_data_handle_t handle);
458
465 size_t (*get_alloc_size) (starpu_data_handle_t handle);
466
472 uint32_t (*footprint) (starpu_data_handle_t handle);
473
480 uint32_t (*alloc_footprint) (starpu_data_handle_t handle);
481
488 int (*compare) (void *data_interface_a, void *data_interface_b);
489
497 int (*alloc_compare) (void *data_interface_a, void *data_interface_b);
498
503 void (*display) (starpu_data_handle_t handle, FILE *f);
504
511 starpu_ssize_t (*describe) (void *data_interface, char *buf, size_t size);
512
516 enum starpu_data_interface_id interfaceid;
517
521 size_t interface_size;
522
525 char is_multiformat;
526
534 char dontcache;
535
538 struct starpu_multiformat_data_interface_ops* (*get_mf_ops)(void *data_interface);
539
556 int (*pack_data) (starpu_data_handle_t handle, unsigned node, void **ptr, starpu_ssize_t *count);
557
563 int (*unpack_data) (starpu_data_handle_t handle, unsigned node, void *ptr, size_t count);
564
568 char *name;
569};
570
592 void starpu_data_register(starpu_data_handle_t *handleptr, int home_node, void *data_interface, struct starpu_data_interface_ops *ops);
593
599 void starpu_data_ptr_register(starpu_data_handle_t handle, unsigned node);
600
605 void starpu_data_register_same(starpu_data_handle_t *handledst, starpu_data_handle_t handlesrc);
606
612 void *starpu_data_handle_to_pointer(starpu_data_handle_t handle, unsigned node);
613
619 int starpu_data_pointer_is_inside(starpu_data_handle_t handle, unsigned node, void *ptr);
620
625 void *starpu_data_get_local_ptr(starpu_data_handle_t handle);
626
630 void *starpu_data_get_interface_on_node(starpu_data_handle_t handle, unsigned memory_node);
631
636 enum starpu_data_interface_id starpu_data_get_interface_id(starpu_data_handle_t handle);
637
648 int starpu_data_pack(starpu_data_handle_t handle, void **ptr, starpu_ssize_t *count);
649
656 int starpu_data_unpack(starpu_data_handle_t handle, void *ptr, size_t count);
657
661 size_t starpu_data_get_size(starpu_data_handle_t handle);
662
666 size_t starpu_data_get_alloc_size(starpu_data_handle_t handle);
667
671 starpu_data_handle_t starpu_data_lookup(const void *ptr);
672
673 int starpu_data_get_home_node(starpu_data_handle_t handle);
674
679 int starpu_data_interface_get_next_id(void);
680
688 int starpu_interface_copy(uintptr_t src, size_t src_offset, unsigned src_node,
689 uintptr_t dst, size_t dst_offset, unsigned dst_node,
690 size_t size, void *async_data);
691
708 int starpu_interface_copy2d(uintptr_t src, size_t src_offset, unsigned src_node,
709 uintptr_t dst, size_t dst_offset, unsigned dst_node,
710 size_t blocksize,
711 size_t numblocks, size_t ld_src, size_t ld_dst,
712 void *async_data);
713
734 int starpu_interface_copy3d(uintptr_t src, size_t src_offset, unsigned src_node,
735 uintptr_t dst, size_t dst_offset, unsigned dst_node,
736 size_t blocksize,
737 size_t numblocks1, size_t ld1_src, size_t ld1_dst,
738 size_t numblocks2, size_t ld2_src, size_t ld2_dst,
739 void *async_data);
740
765 int starpu_interface_copy4d(uintptr_t src, size_t src_offset, unsigned src_node,
766 uintptr_t dst, size_t dst_offset, unsigned dst_node,
767 size_t blocksize,
768 size_t numblocks1, size_t ld1_src, size_t ld1_dst,
769 size_t numblocks2, size_t ld2_src, size_t ld2_dst,
770 size_t numblocks3, size_t ld3_src, size_t ld3_dst,
771 void *async_data);
772
782 void starpu_interface_start_driver_copy_async(unsigned src_node, unsigned dst_node, double *start);
783
787 void starpu_interface_end_driver_copy_async(unsigned src_node, unsigned dst_node, double start);
788
793 void starpu_interface_data_copy(unsigned src_node, unsigned dst_node, size_t size);
794
800uintptr_t starpu_malloc_on_node_flags(unsigned dst_node, size_t size, int flags);
801
807uintptr_t starpu_malloc_on_node(unsigned dst_node, size_t size);
808
813 void starpu_free_on_node_flags(unsigned dst_node, uintptr_t addr, size_t size, int flags);
814
819 void starpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size);
820
825 void starpu_malloc_on_node_set_default_flags(unsigned node, int flags);
826
834 extern struct starpu_data_interface_ops starpu_interface_matrix_ops;
835
839 struct starpu_matrix_interface
840{
841 enum starpu_data_interface_id id;
842 uintptr_t ptr;
843 uintptr_t dev_handle;
844 size_t offset;
845 uint32_t nx;
846 uint32_t ny;
847 uint32_t ld;
851 size_t elemsize;
852 size_t allocsize;
853};
854
869 void starpu_matrix_data_register(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t ld, uint32_t nx, uint32_t ny, size_t elemsize);
870
875 void starpu_matrix_data_register_allocsize(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t ld, uint32_t nx, uint32_t ny, size_t elemsize, size_t allocsize);
876
882 void starpu_matrix_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset, uint32_t ld);
883
888uint32_t starpu_matrix_get_nx(starpu_data_handle_t handle);
889
894uint32_t starpu_matrix_get_ny(starpu_data_handle_t handle);
895
900uint32_t starpu_matrix_get_local_ld(starpu_data_handle_t handle);
901
905uintptr_t starpu_matrix_get_local_ptr(starpu_data_handle_t handle);
906
911 size_t starpu_matrix_get_elemsize(starpu_data_handle_t handle);
912
916 size_t starpu_matrix_get_allocsize(starpu_data_handle_t handle);
917
918#if defined(STARPU_HAVE_STATEMENT_EXPRESSIONS) && defined(STARPU_DEBUG)
919#define STARPU_MATRIX_CHECK(interface) STARPU_ASSERT_MSG((((struct starpu_matrix_interface *)(interface))->id) == STARPU_MATRIX_INTERFACE_ID, "Error. The given data is not a matrix.")
920#define STARPU_MATRIX_GET_PTR(interface) ({ STARPU_MATRIX_CHECK(interface); (((struct starpu_matrix_interface *)(interface))->ptr) ; })
921#define STARPU_MATRIX_GET_DEV_HANDLE(interface) ({ STARPU_MATRIX_CHECK(interface); (((struct starpu_matrix_interface *)(interface))->dev_handle) ; })
922#define STARPU_MATRIX_GET_OFFSET(interface) ({ STARPU_MATRIX_CHECK(interface); (((struct starpu_matrix_interface *)(interface))->offset) ; })
923#define STARPU_MATRIX_GET_NX(interface) ({ STARPU_MATRIX_CHECK(interface); (((struct starpu_matrix_interface *)(interface))->nx) ; })
924#define STARPU_MATRIX_GET_NY(interface) ({ STARPU_MATRIX_CHECK(interface); (((struct starpu_matrix_interface *)(interface))->ny) ; })
925#define STARPU_MATRIX_GET_LD(interface) ({ STARPU_MATRIX_CHECK(interface); (((struct starpu_matrix_interface *)(interface))->ld) ; })
926#define STARPU_MATRIX_GET_ELEMSIZE(interface) ({ STARPU_MATRIX_CHECK(interface); (((struct starpu_matrix_interface *)(interface))->elemsize) ; })
927#define STARPU_MATRIX_GET_ALLOCSIZE(interface) ({ STARPU_MATRIX_CHECK(interface); (((struct starpu_matrix_interface *)(interface))->allocsize) ; })
928#else
934#define STARPU_MATRIX_GET_PTR(interface) (((struct starpu_matrix_interface *)(interface))->ptr)
941#define STARPU_MATRIX_GET_DEV_HANDLE(interface) (((struct starpu_matrix_interface *)(interface))->dev_handle)
946#define STARPU_MATRIX_GET_OFFSET(interface) (((struct starpu_matrix_interface *)(interface))->offset)
951#define STARPU_MATRIX_GET_NX(interface) (((struct starpu_matrix_interface *)(interface))->nx)
956#define STARPU_MATRIX_GET_NY(interface) (((struct starpu_matrix_interface *)(interface))->ny)
961#define STARPU_MATRIX_GET_LD(interface) (((struct starpu_matrix_interface *)(interface))->ld)
966#define STARPU_MATRIX_GET_ELEMSIZE(interface) (((struct starpu_matrix_interface *)(interface))->elemsize)
970#define STARPU_MATRIX_GET_ALLOCSIZE(interface) (((struct starpu_matrix_interface *)(interface))->allocsize)
971#endif
972
977#define STARPU_MATRIX_SET_NX(interface, newnx) do { \
978 STARPU_MATRIX_CHECK(interface); \
979 (((struct starpu_matrix_interface *)(interface))->nx) = (newnx); \
980} while (0)
985#define STARPU_MATRIX_SET_NY(interface, newny) do { \
986 STARPU_MATRIX_CHECK(interface); \
987 (((struct starpu_matrix_interface *)(interface))->ny) = (newny); \
988} while(0)
994#define STARPU_MATRIX_SET_LD(interface, newld) do { \
995 STARPU_MATRIX_CHECK(interface); \
996 (((struct starpu_matrix_interface *)(interface))->ld) = (newld); \
997} while(0)
998
1006 extern struct starpu_data_interface_ops starpu_interface_coo_ops;
1007
1011 struct starpu_coo_interface
1012{
1013 enum starpu_data_interface_id id;
1015 uint32_t *columns;
1016 uint32_t *rows;
1017 uintptr_t values;
1018 uint32_t nx;
1019 uint32_t ny;
1020 uint32_t n_values;
1021 size_t elemsize;
1022};
1023
1029 void starpu_coo_data_register(starpu_data_handle_t *handleptr, int home_node, uint32_t nx, uint32_t ny, uint32_t n_values, uint32_t *columns, uint32_t *rows, uintptr_t values, size_t elemsize);
1030
1035#define STARPU_COO_GET_COLUMNS(interface) (((struct starpu_coo_interface *)(interface))->columns)
1042#define STARPU_COO_GET_COLUMNS_DEV_HANDLE(interface) (((struct starpu_coo_interface *)(interface))->columns)
1047#define STARPU_COO_GET_ROWS(interface) (((struct starpu_coo_interface *)(interface))->rows)
1053#define STARPU_COO_GET_ROWS_DEV_HANDLE(interface) (((struct starpu_coo_interface *)(interface))->rows)
1058#define STARPU_COO_GET_VALUES(interface) (((struct starpu_coo_interface *)(interface))->values)
1064#define STARPU_COO_GET_VALUES_DEV_HANDLE(interface) (((struct starpu_coo_interface *)(interface))->values)
1069#define STARPU_COO_GET_OFFSET 0
1074#define STARPU_COO_GET_NX(interface) (((struct starpu_coo_interface *)(interface))->nx)
1079#define STARPU_COO_GET_NY(interface) (((struct starpu_coo_interface *)(interface))->ny)
1084#define STARPU_COO_GET_NVALUES(interface) (((struct starpu_coo_interface *)(interface))->n_values)
1089#define STARPU_COO_GET_ELEMSIZE(interface) (((struct starpu_coo_interface *)(interface))->elemsize)
1090
1098 extern struct starpu_data_interface_ops starpu_interface_block_ops;
1099
1100/* TODO: rename to 3dmatrix? */
1101/* TODO: add allocsize support */
1105 struct starpu_block_interface
1106{
1107 enum starpu_data_interface_id id;
1109 uintptr_t ptr;
1110 uintptr_t dev_handle;
1111 size_t offset;
1112 uint32_t nx;
1113 uint32_t ny;
1114 uint32_t nz;
1115 uint32_t ldy;
1116 uint32_t ldz;
1117 size_t elemsize;
1118};
1119
1133 void starpu_block_data_register(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t ldy, uint32_t ldz, uint32_t nx, uint32_t ny, uint32_t nz, size_t elemsize);
1134
1141 void starpu_block_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset, uint32_t ldy, uint32_t ldz);
1142
1147uint32_t starpu_block_get_nx(starpu_data_handle_t handle);
1148
1153uint32_t starpu_block_get_ny(starpu_data_handle_t handle);
1154
1159uint32_t starpu_block_get_nz(starpu_data_handle_t handle);
1160
1165uint32_t starpu_block_get_local_ldy(starpu_data_handle_t handle);
1166
1171uint32_t starpu_block_get_local_ldz(starpu_data_handle_t handle);
1172
1176uintptr_t starpu_block_get_local_ptr(starpu_data_handle_t handle);
1177
1182 size_t starpu_block_get_elemsize(starpu_data_handle_t handle);
1183
1184#if defined(STARPU_HAVE_STATEMENT_EXPRESSIONS) && defined(STARPU_DEBUG)
1185#define STARPU_BLOCK_CHECK(interface) STARPU_ASSERT_MSG((((struct starpu_block_interface *)(interface))->id) == STARPU_BLOCK_INTERFACE_ID, "Error. The given data is not a block.")
1186#define STARPU_BLOCK_GET_PTR(interface) ({ STARPU_BLOCK_CHECK(interface); (((struct starpu_block_interface *)(interface))->ptr) ; })
1187#define STARPU_BLOCK_GET_DEV_HANDLE(interface) ({ STARPU_BLOCK_CHECK(interface); (((struct starpu_block_interface *)(interface))->dev_handle) ; })
1188#define STARPU_BLOCK_GET_OFFSET(interface) ({ STARPU_BLOCK_CHECK(interface); (((struct starpu_block_interface *)(interface))->offset) ; })
1189#define STARPU_BLOCK_GET_NX(interface) ({ STARPU_BLOCK_CHECK(interface); (((struct starpu_block_interface *)(interface))->nx) ; })
1190#define STARPU_BLOCK_GET_NY(interface) ({ STARPU_BLOCK_CHECK(interface); (((struct starpu_block_interface *)(interface))->ny) ; })
1191#define STARPU_BLOCK_GET_NZ(interface) ({ STARPU_BLOCK_CHECK(interface); (((struct starpu_block_interface *)(interface))->nz) ; })
1192#define STARPU_BLOCK_GET_LDY(interface) ({ STARPU_BLOCK_CHECK(interface); (((struct starpu_block_interface *)(interface))->ldy) ; })
1193#define STARPU_BLOCK_GET_LDZ(interface) ({ STARPU_BLOCK_CHECK(interface); (((struct starpu_block_interface *)(interface))->ldz) ; })
1194#define STARPU_BLOCK_GET_ELEMSIZE(interface) ({ STARPU_BLOCK_CHECK(interface); (((struct starpu_block_interface *)(interface))->elemsize) ; })
1195#else
1199#define STARPU_BLOCK_GET_PTR(interface) (((struct starpu_block_interface *)(interface))->ptr)
1206#define STARPU_BLOCK_GET_DEV_HANDLE(interface) (((struct starpu_block_interface *)(interface))->dev_handle)
1211#define STARPU_BLOCK_GET_OFFSET(interface) (((struct starpu_block_interface *)(interface))->offset)
1216#define STARPU_BLOCK_GET_NX(interface) (((struct starpu_block_interface *)(interface))->nx)
1221#define STARPU_BLOCK_GET_NY(interface) (((struct starpu_block_interface *)(interface))->ny)
1226#define STARPU_BLOCK_GET_NZ(interface) (((struct starpu_block_interface *)(interface))->nz)
1231#define STARPU_BLOCK_GET_LDY(interface) (((struct starpu_block_interface *)(interface))->ldy)
1237#define STARPU_BLOCK_GET_LDZ(interface) (((struct starpu_block_interface *)(interface))->ldz)
1242#define STARPU_BLOCK_GET_ELEMSIZE(interface) (((struct starpu_block_interface *)(interface))->elemsize)
1243#endif
1244
1252 extern struct starpu_data_interface_ops starpu_interface_vector_ops;
1253
1256 struct starpu_vector_interface
1257{
1258 enum starpu_data_interface_id id;
1260 uintptr_t ptr;
1261 uintptr_t dev_handle;
1262 size_t offset;
1263 uint32_t nx;
1264 size_t elemsize;
1265 uint32_t slice_base;
1266 size_t allocsize;
1267};
1268
1279 void starpu_vector_data_register(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t nx, size_t elemsize);
1280
1285 void starpu_vector_data_register_allocsize(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t nx, size_t elemsize, size_t allocsize);
1286
1292 void starpu_vector_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset);
1293
1297uint32_t starpu_vector_get_nx(starpu_data_handle_t handle);
1298
1302 size_t starpu_vector_get_elemsize(starpu_data_handle_t handle);
1303
1307 size_t starpu_vector_get_allocsize(starpu_data_handle_t handle);
1308
1312uintptr_t starpu_vector_get_local_ptr(starpu_data_handle_t handle);
1313
1314#if defined(STARPU_HAVE_STATEMENT_EXPRESSIONS) && defined(STARPU_DEBUG)
1315#define STARPU_VECTOR_CHECK(interface) STARPU_ASSERT_MSG((((struct starpu_vector_interface *)(interface))->id) == STARPU_VECTOR_INTERFACE_ID, "Error. The given data is not a vector.")
1316#define STARPU_VECTOR_GET_PTR(interface) ({ STARPU_VECTOR_CHECK(interface); (((struct starpu_vector_interface *)(interface))->ptr); })
1317#define STARPU_VECTOR_GET_DEV_HANDLE(interface) ({ STARPU_VECTOR_CHECK(interface); (((struct starpu_vector_interface *)(interface))->dev_handle); })
1318#define STARPU_VECTOR_GET_OFFSET(interface) ({ STARPU_VECTOR_CHECK(interface); (((struct starpu_vector_interface *)(interface))->offset); })
1319#define STARPU_VECTOR_GET_NX(interface) ({ STARPU_VECTOR_CHECK(interface); (((struct starpu_vector_interface *)(interface))->nx); })
1320#define STARPU_VECTOR_GET_ELEMSIZE(interface) ({ STARPU_VECTOR_CHECK(interface); (((struct starpu_vector_interface *)(interface))->elemsize); })
1321#define STARPU_VECTOR_GET_ALLOCSIZE(interface) ({ STARPU_VECTOR_CHECK(interface); (((struct starpu_vector_interface *)(interface))->allocsize); })
1322#define STARPU_VECTOR_GET_SLICE_BASE(interface) ({ STARPU_VECTOR_CHECK(interface); (((struct starpu_vector_interface *)(interface))->slice_base); })
1323#else
1329#define STARPU_VECTOR_GET_PTR(interface) (((struct starpu_vector_interface *)(interface))->ptr)
1335#define STARPU_VECTOR_GET_DEV_HANDLE(interface) (((struct starpu_vector_interface *)(interface))->dev_handle)
1340#define STARPU_VECTOR_GET_OFFSET(interface) (((struct starpu_vector_interface *)(interface))->offset)
1345#define STARPU_VECTOR_GET_NX(interface) (((struct starpu_vector_interface *)(interface))->nx)
1350#define STARPU_VECTOR_GET_ELEMSIZE(interface) (((struct starpu_vector_interface *)(interface))->elemsize)
1355#define STARPU_VECTOR_GET_ALLOCSIZE(interface) (((struct starpu_vector_interface *)(interface))->allocsize)
1360#define STARPU_VECTOR_GET_SLICE_BASE(interface) (((struct starpu_vector_interface *)(interface))->slice_base)
1361#endif
1362
1367#define STARPU_VECTOR_SET_NX(interface, newnx) do { \
1368 STARPU_VECTOR_CHECK(interface); \
1369 (((struct starpu_vector_interface *)(interface))->nx) = (newnx); \
1370} while(0)
1371
1379 extern struct starpu_data_interface_ops starpu_interface_variable_ops;
1380
1385 struct starpu_variable_interface
1386{
1387 enum starpu_data_interface_id id;
1389 uintptr_t ptr;
1390 uintptr_t dev_handle;
1391 size_t offset;
1392 size_t elemsize;
1393};
1394
1406 void starpu_variable_data_register(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, size_t size);
1407
1413 void starpu_variable_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset);
1414
1418 size_t starpu_variable_get_elemsize(starpu_data_handle_t handle);
1419
1423uintptr_t starpu_variable_get_local_ptr(starpu_data_handle_t handle);
1424
1425#if defined(STARPU_HAVE_STATEMENT_EXPRESSIONS) && defined(STARPU_DEBUG)
1426#define STARPU_VARIABLE_CHECK(interface) STARPU_ASSERT_MSG((((struct starpu_variable_interface *)(interface))->id) == STARPU_VARIABLE_INTERFACE_ID, "Error. The given data is not a variable.")
1427#define STARPU_VARIABLE_GET_PTR(interface) ({ STARPU_VARIABLE_CHECK(interface); (((struct starpu_variable_interface *)(interface))->ptr) ; })
1428#define STARPU_VARIABLE_GET_OFFSET(interface) ({ STARPU_VARIABLE_CHECK(interface); (((struct starpu_variable_interface *)(interface))->offset) ; })
1429#define STARPU_VARIABLE_GET_ELEMSIZE(interface) ({ STARPU_VARIABLE_CHECK(interface); (((struct starpu_variable_interface *)(interface))->elemsize) ; })
1430#define STARPU_VARIABLE_GET_DEV_HANDLE(interface) ({ STARPU_VARIABLE_CHECK(interface); (((struct starpu_variable_interface *)(interface))->ptr) ; })
1431#else
1435#define STARPU_VARIABLE_GET_PTR(interface) (((struct starpu_variable_interface *)(interface))->ptr)
1440#define STARPU_VARIABLE_GET_OFFSET(interface) (((struct starpu_variable_interface *)(interface))->offset)
1444#define STARPU_VARIABLE_GET_ELEMSIZE(interface) (((struct starpu_variable_interface *)(interface))->elemsize)
1451#define STARPU_VARIABLE_GET_DEV_HANDLE(interface) (((struct starpu_variable_interface *)(interface))->ptr)
1452#endif
1453
1461 extern struct starpu_data_interface_ops starpu_interface_void_ops;
1462
1471 void starpu_void_data_register(starpu_data_handle_t *handle);
1472
1480 extern struct starpu_data_interface_ops starpu_interface_csr_ops;
1481
1486 struct starpu_csr_interface
1487{
1488 enum starpu_data_interface_id id;
1490 uint32_t nnz;
1491 uint32_t nrow;
1492 uintptr_t nzval;
1493 uint32_t *colind;
1494 uint32_t *rowptr;
1496 uint32_t firstentry;
1498 size_t elemsize;
1499};
1500
1504 void starpu_csr_data_register(starpu_data_handle_t *handle, int home_node, uint32_t nnz, uint32_t nrow, uintptr_t nzval, uint32_t *colind, uint32_t *rowptr, uint32_t firstentry, size_t elemsize);
1505
1510uint32_t starpu_csr_get_nnz(starpu_data_handle_t handle);
1511
1516uint32_t starpu_csr_get_nrow(starpu_data_handle_t handle);
1517
1522uint32_t starpu_csr_get_firstentry(starpu_data_handle_t handle);
1523
1528uintptr_t starpu_csr_get_local_nzval(starpu_data_handle_t handle);
1529
1534uint32_t *starpu_csr_get_local_colind(starpu_data_handle_t handle);
1535
1540uint32_t *starpu_csr_get_local_rowptr(starpu_data_handle_t handle);
1541
1546 size_t starpu_csr_get_elemsize(starpu_data_handle_t handle);
1547
1552#define STARPU_CSR_GET_NNZ(interface) (((struct starpu_csr_interface *)(interface))->nnz)
1557#define STARPU_CSR_GET_NROW(interface) (((struct starpu_csr_interface *)(interface))->nrow)
1562#define STARPU_CSR_GET_NZVAL(interface) (((struct starpu_csr_interface *)(interface))->nzval)
1568#define STARPU_CSR_GET_NZVAL_DEV_HANDLE(interface) (((struct starpu_csr_interface *)(interface))->nnz)
1573#define STARPU_CSR_GET_COLIND(interface) (((struct starpu_csr_interface *)(interface))->colind)
1579#define STARPU_CSR_GET_COLIND_DEV_HANDLE(interface) (((struct starpu_csr_interface *)(interface))->colind)
1584#define STARPU_CSR_GET_ROWPTR(interface) (((struct starpu_csr_interface *)(interface))->rowptr)
1590#define STARPU_CSR_GET_ROWPTR_DEV_HANDLE(interface) (((struct starpu_csr_interface *)(interface))->rowptr)
1595#define STARPU_CSR_GET_OFFSET 0
1600#define STARPU_CSR_GET_FIRSTENTRY(interface) (((struct starpu_csr_interface *)(interface))->firstentry)
1605#define STARPU_CSR_GET_ELEMSIZE(interface) (((struct starpu_csr_interface *)(interface))->elemsize)
1606
1614 extern struct starpu_data_interface_ops starpu_interface_bcsr_ops;
1615
1625 struct starpu_bcsr_interface
1626{
1627 enum starpu_data_interface_id id;
1629 uint32_t nnz;
1630 uint32_t nrow;
1632 uintptr_t nzval;
1633 uint32_t *colind;
1634 uint32_t *rowptr;
1645 uint32_t firstentry;
1647 uint32_t r;
1648 uint32_t c;
1650 size_t elemsize;
1651};
1652
1719 void starpu_bcsr_data_register(starpu_data_handle_t *handle, int home_node, uint32_t nnz, uint32_t nrow, uintptr_t nzval, uint32_t *colind, uint32_t *rowptr, uint32_t firstentry, uint32_t r, uint32_t c, size_t elemsize);
1720
1725uint32_t starpu_bcsr_get_nnz(starpu_data_handle_t handle);
1726
1731uint32_t starpu_bcsr_get_nrow(starpu_data_handle_t handle);
1732
1737uint32_t starpu_bcsr_get_firstentry(starpu_data_handle_t handle);
1738
1743uintptr_t starpu_bcsr_get_local_nzval(starpu_data_handle_t handle);
1744
1749uint32_t *starpu_bcsr_get_local_colind(starpu_data_handle_t handle);
1750
1755uint32_t *starpu_bcsr_get_local_rowptr(starpu_data_handle_t handle);
1756
1760uint32_t starpu_bcsr_get_r(starpu_data_handle_t handle);
1761
1765uint32_t starpu_bcsr_get_c(starpu_data_handle_t handle);
1766
1771 size_t starpu_bcsr_get_elemsize(starpu_data_handle_t handle);
1772
1777#define STARPU_BCSR_GET_NNZ(interface) (((struct starpu_bcsr_interface *)(interface))->nnz)
1782#define STARPU_BCSR_GET_NROW(interface) (((struct starpu_bcsr_interface *)(interface))->nrow)
1787#define STARPU_BCSR_GET_NZVAL(interface) (((struct starpu_bcsr_interface *)(interface))->nzval)
1793#define STARPU_BCSR_GET_NZVAL_DEV_HANDLE(interface) (((struct starpu_bcsr_interface *)(interface))->nnz)
1798#define STARPU_BCSR_GET_COLIND(interface) (((struct starpu_bcsr_interface *)(interface))->colind)
1804#define STARPU_BCSR_GET_COLIND_DEV_HANDLE(interface) (((struct starpu_bcsr_interface *)(interface))->colind)
1809#define STARPU_BCSR_GET_ROWPTR(interface) (((struct starpu_bcsr_interface *)(interface))->rowptr)
1815#define STARPU_BCSR_GET_ROWPTR_DEV_HANDLE(interface) (((struct starpu_bcsr_interface *)(interface))->rowptr)
1820#define STARPU_BCSR_GET_FIRSTENTRY(interface) (((struct starpu_bcsr_interface *)(interface))->firstentry)
1825#define STARPU_BCSR_GET_R(interface) (((struct starpu_bcsr_interface *)(interface))->r)
1830#define STARPU_BCSR_GET_C(interface) (((struct starpu_bcsr_interface *)(interface))->c)
1834#define STARPU_BCSR_GET_ELEMSIZE(interface) (((struct starpu_bcsr_interface *)(interface))->elemsize)
1839#define STARPU_BCSR_GET_OFFSET 0
1840
1851 struct starpu_multiformat_data_interface_ops
1852{
1853 size_t cpu_elemsize;
1854 size_t opencl_elemsize;
1855 struct starpu_codelet *cpu_to_opencl_cl;
1856 struct starpu_codelet *opencl_to_cpu_cl;
1857 size_t cuda_elemsize;
1858 struct starpu_codelet *cpu_to_cuda_cl;
1859 struct starpu_codelet *cuda_to_cpu_cl;
1860 size_t mic_elemsize;
1861 struct starpu_codelet *cpu_to_mic_cl;
1862 struct starpu_codelet *mic_to_cpu_cl;
1863};
1864
1865 struct starpu_multiformat_interface
1866{
1867 enum starpu_data_interface_id id;
1868
1869 void *cpu_ptr;
1870 void *cuda_ptr;
1871 void *opencl_ptr;
1872 void *mic_ptr;
1873 uint32_t nx;
1874 struct starpu_multiformat_data_interface_ops *ops;
1875};
1876
1885 void starpu_multiformat_data_register(starpu_data_handle_t *handle, int home_node, void *ptr, uint32_t nobjects, struct starpu_multiformat_data_interface_ops *format_ops);
1886
1890#define STARPU_MULTIFORMAT_GET_CPU_PTR(interface) (((struct starpu_multiformat_interface *)(interface))->cpu_ptr)
1894#define STARPU_MULTIFORMAT_GET_CUDA_PTR(interface) (((struct starpu_multiformat_interface *)(interface))->cuda_ptr)
1898#define STARPU_MULTIFORMAT_GET_OPENCL_PTR(interface) (((struct starpu_multiformat_interface *)(interface))->opencl_ptr)
1902#define STARPU_MULTIFORMAT_GET_MIC_PTR(interface) (((struct starpu_multiformat_interface *)(interface))->mic_ptr)
1906#define STARPU_MULTIFORMAT_GET_NX(interface) (((struct starpu_multiformat_interface *)(interface))->nx)
1907
1912#ifdef __cplusplus
1913}
1914#endif
1915
1916#endif /* __STARPU_DATA_INTERFACES_H__ */
starpu_codelet
Definition: starpu_task.h:250
starpu_multiformat_data_interface_ops::cuda_elemsize
size_t cuda_elemsize
Definition: starpu_data_interfaces.h:1857
starpu_variable_interface::dev_handle
uintptr_t dev_handle
Definition: starpu_data_interfaces.h:1390
starpu_data_interface_ops::footprint
uint32_t(* footprint)(starpu_data_handle_t handle)
Definition: starpu_data_interfaces.h:472
starpu_block_interface::offset
size_t offset
Definition: starpu_data_interfaces.h:1111
starpu_variable_interface::id
enum starpu_data_interface_id id
Definition: starpu_data_interfaces.h:1387
starpu_data_copy_methods::mpi_ms_to_mpi_ms_async
int(* mpi_ms_to_mpi_ms_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *event)
Definition: starpu_data_interfaces.h:302
starpu_data_interface_ops::unregister_data_handle
void(* unregister_data_handle)(starpu_data_handle_t handle)
Definition: starpu_data_interfaces.h:389
starpu_data_copy_methods::mpi_ms_to_ram_async
int(* mpi_ms_to_ram_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *event)
Definition: starpu_data_interfaces.h:292
starpu_data_interface_ops::get_size
size_t(* get_size)(starpu_data_handle_t handle)
Definition: starpu_data_interfaces.h:457
starpu_data_copy_methods::can_copy
int(* can_copy)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, unsigned handling_node)
Definition: starpu_data_interfaces.h:101
starpu_bcsr_interface::nrow
uint32_t nrow
Definition: starpu_data_interfaces.h:1630
starpu_bcsr_interface::elemsize
size_t elemsize
Definition: starpu_data_interfaces.h:1650
starpu_bcsr_interface::nnz
uint32_t nnz
Definition: starpu_data_interfaces.h:1629
starpu_data_copy_methods::cuda_to_ram
int(* cuda_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:136
starpu_data_interface_ops::alloc_compare
int(* alloc_compare)(void *data_interface_a, void *data_interface_b)
Definition: starpu_data_interfaces.h:497
starpu_variable_interface::ptr
uintptr_t ptr
Definition: starpu_data_interfaces.h:1389
starpu_data_copy_methods::mic_to_ram
int(* mic_to_ram)(void *src_interface, unsigned srd_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:178
starpu_data_interface_ops::dontcache
char dontcache
Definition: starpu_data_interfaces.h:534
starpu_data_copy_methods::ram_to_mpi_ms_async
int(* ram_to_mpi_ms_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *event)
Definition: starpu_data_interfaces.h:282
starpu_multiformat_data_interface_ops::mic_elemsize
size_t mic_elemsize
Definition: starpu_data_interfaces.h:1860
starpu_matrix_interface::allocsize
size_t allocsize
Definition: starpu_data_interfaces.h:852
starpu_coo_interface::values
uintptr_t values
Definition: starpu_data_interfaces.h:1017
starpu_data_copy_methods::ram_to_ram
int(* ram_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:108
starpu_data_copy_methods::cuda_to_opencl
int(* cuda_to_opencl)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:150
starpu_csr_interface::colind
uint32_t * colind
Definition: starpu_data_interfaces.h:1493
starpu_csr_interface::elemsize
size_t elemsize
Definition: starpu_data_interfaces.h:1498
starpu_matrix_interface::elemsize
size_t elemsize
Definition: starpu_data_interfaces.h:851
starpu_csr_interface::firstentry
uint32_t firstentry
Definition: starpu_data_interfaces.h:1496
starpu_matrix_interface::ptr
uintptr_t ptr
Definition: starpu_data_interfaces.h:842
starpu_vector_interface::dev_handle
uintptr_t dev_handle
Definition: starpu_data_interfaces.h:1261
starpu_block_interface::ldy
uint32_t ldy
Definition: starpu_data_interfaces.h:1115
starpu_block_interface::nz
uint32_t nz
Definition: starpu_data_interfaces.h:1114
starpu_data_copy_methods::mpi_ms_to_ram
int(* mpi_ms_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:192
starpu_data_copy_methods::ram_to_mic
int(* ram_to_mic)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:129
starpu_data_copy_methods::ram_to_mic_async
int(* ram_to_mic_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:312
starpu_data_copy_methods::ram_to_cuda_async
int(* ram_to_cuda_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream)
Definition: starpu_data_interfaces.h:210
starpu_bcsr_interface::colind
uint32_t * colind
Definition: starpu_data_interfaces.h:1633
starpu_variable_interface::elemsize
size_t elemsize
Definition: starpu_data_interfaces.h:1392
starpu_matrix_interface::ld
uint32_t ld
Definition: starpu_data_interfaces.h:847
starpu_coo_interface::id
enum starpu_data_interface_id id
Definition: starpu_data_interfaces.h:1013
starpu_coo_interface::rows
uint32_t * rows
Definition: starpu_data_interfaces.h:1016
starpu_data_interface_ops::pack_data
int(* pack_data)(starpu_data_handle_t handle, unsigned node, void **ptr, starpu_ssize_t *count)
Definition: starpu_data_interfaces.h:556
starpu_data_copy_methods::ram_to_cuda
int(* ram_to_cuda)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:115
starpu_data_copy_methods::opencl_to_cuda
int(* opencl_to_cuda)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:164
starpu_multiformat_data_interface_ops::cpu_elemsize
size_t cpu_elemsize
Definition: starpu_data_interfaces.h:1853
starpu_data_copy_methods::mic_to_ram_async
int(* mic_to_ram_async)(void *src_interface, unsigned srd_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:322
starpu_csr_interface::nzval
uintptr_t nzval
Definition: starpu_data_interfaces.h:1492
starpu_data_interface_ops::interfaceid
enum starpu_data_interface_id interfaceid
Definition: starpu_data_interfaces.h:516
starpu_vector_interface::ptr
uintptr_t ptr
Definition: starpu_data_interfaces.h:1260
starpu_data_interface_ops::compare
int(* compare)(void *data_interface_a, void *data_interface_b)
Definition: starpu_data_interfaces.h:488
starpu_multiformat_data_interface_ops::opencl_elemsize
size_t opencl_elemsize
Definition: starpu_data_interfaces.h:1854
starpu_block_interface::ptr
uintptr_t ptr
Definition: starpu_data_interfaces.h:1109
starpu_coo_interface::n_values
uint32_t n_values
Definition: starpu_data_interfaces.h:1020
starpu_data_copy_methods::ram_to_mpi_ms
int(* ram_to_mpi_ms)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:185
starpu_block_interface::dev_handle
uintptr_t dev_handle
Definition: starpu_data_interfaces.h:1110
starpu_bcsr_interface::rowptr
uint32_t * rowptr
Definition: starpu_data_interfaces.h:1634
starpu_data_interface_ops::interface_size
size_t interface_size
Definition: starpu_data_interfaces.h:521
starpu_csr_interface::id
enum starpu_data_interface_id id
Definition: starpu_data_interfaces.h:1488
starpu_vector_interface::slice_base
uint32_t slice_base
Definition: starpu_data_interfaces.h:1265
starpu_csr_interface::nrow
uint32_t nrow
Definition: starpu_data_interfaces.h:1491
starpu_data_copy_methods::opencl_to_ram
int(* opencl_to_ram)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:157
starpu_block_interface::ny
uint32_t ny
Definition: starpu_data_interfaces.h:1113
starpu_data_copy_methods::opencl_to_opencl
int(* opencl_to_opencl)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:171
starpu_vector_interface::elemsize
size_t elemsize
Definition: starpu_data_interfaces.h:1264
starpu_data_interface_ops::name
char * name
Definition: starpu_data_interfaces.h:568
starpu_data_interface_ops::get_alloc_size
size_t(* get_alloc_size)(starpu_data_handle_t handle)
Definition: starpu_data_interfaces.h:465
starpu_bcsr_interface::firstentry
uint32_t firstentry
Definition: starpu_data_interfaces.h:1645
starpu_data_copy_methods::cuda_to_cuda
int(* cuda_to_cuda)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:143
starpu_block_interface::ldz
uint32_t ldz
Definition: starpu_data_interfaces.h:1116
starpu_bcsr_interface::r
uint32_t r
Definition: starpu_data_interfaces.h:1647
starpu_multiformat_data_interface_ops::cpu_to_cuda_cl
struct starpu_codelet * cpu_to_cuda_cl
Definition: starpu_data_interfaces.h:1858
starpu_data_copy_methods::cuda_to_cuda_async
int(* cuda_to_cuda_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream)
Definition: starpu_data_interfaces.h:230
starpu_csr_interface::nnz
uint32_t nnz
Definition: starpu_data_interfaces.h:1490
starpu_matrix_interface::offset
size_t offset
Definition: starpu_data_interfaces.h:844
starpu_matrix_interface::id
enum starpu_data_interface_id id
Definition: starpu_data_interfaces.h:841
starpu_vector_interface::offset
size_t offset
Definition: starpu_data_interfaces.h:1262
starpu_data_interface_ops::display
void(* display)(starpu_data_handle_t handle, FILE *f)
Definition: starpu_data_interfaces.h:503
starpu_multiformat_data_interface_ops::mic_to_cpu_cl
struct starpu_codelet * mic_to_cpu_cl
Definition: starpu_data_interfaces.h:1862
starpu_data_interface_ops::register_data_handle
void(* register_data_handle)(starpu_data_handle_t handle, unsigned home_node, void *data_interface)
Definition: starpu_data_interfaces.h:378
starpu_data_interface_ops::unpack_data
int(* unpack_data)(starpu_data_handle_t handle, unsigned node, void *ptr, size_t count)
Definition: starpu_data_interfaces.h:563
starpu_data_interface_ops::alloc_footprint
uint32_t(* alloc_footprint)(starpu_data_handle_t handle)
Definition: starpu_data_interfaces.h:480
starpu_vector_interface::allocsize
size_t allocsize
Definition: starpu_data_interfaces.h:1266
starpu_vector_interface::id
enum starpu_data_interface_id id
Definition: starpu_data_interfaces.h:1258
starpu_coo_interface::columns
uint32_t * columns
Definition: starpu_data_interfaces.h:1015
starpu_multiformat_data_interface_ops::cpu_to_opencl_cl
struct starpu_codelet * cpu_to_opencl_cl
Definition: starpu_data_interfaces.h:1855
starpu_matrix_interface::dev_handle
uintptr_t dev_handle
Definition: starpu_data_interfaces.h:843
starpu_data_interface_ops::pointer_is_inside
int(* pointer_is_inside)(void *data_interface, unsigned node, void *ptr)
Definition: starpu_data_interfaces.h:452
starpu_data_copy_methods::cuda_to_ram_async
int(* cuda_to_ram_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream)
Definition: starpu_data_interfaces.h:220
starpu_data_interface_ops::init
void(* init)(void *data_interface)
Definition: starpu_data_interfaces.h:418
starpu_data_interface_ops::free_data_on_node
void(* free_data_on_node)(void *data_interface, unsigned node)
Definition: starpu_data_interfaces.h:411
starpu_coo_interface::elemsize
size_t elemsize
Definition: starpu_data_interfaces.h:1021
starpu_data_copy_methods::opencl_to_opencl_async
int(* opencl_to_opencl_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)
Definition: starpu_data_interfaces.h:267
starpu_bcsr_interface::c
uint32_t c
Definition: starpu_data_interfaces.h:1648
starpu_data_interface_ops::describe
starpu_ssize_t(* describe)(void *data_interface, char *buf, size_t size)
Definition: starpu_data_interfaces.h:511
starpu_multiformat_data_interface_ops::cuda_to_cpu_cl
struct starpu_codelet * cuda_to_cpu_cl
Definition: starpu_data_interfaces.h:1859
starpu_multiformat_data_interface_ops::opencl_to_cpu_cl
struct starpu_codelet * opencl_to_cpu_cl
Definition: starpu_data_interfaces.h:1856
starpu_matrix_interface::ny
uint32_t ny
Definition: starpu_data_interfaces.h:846
starpu_vector_interface::nx
uint32_t nx
Definition: starpu_data_interfaces.h:1263
starpu_multiformat_data_interface_ops::cpu_to_mic_cl
struct starpu_codelet * cpu_to_mic_cl
Definition: starpu_data_interfaces.h:1861
starpu_data_copy_methods::any_to_any
int(* any_to_any)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *async_data)
Definition: starpu_data_interfaces.h:341
starpu_data_copy_methods::opencl_to_ram_async
int(* opencl_to_ram_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)
Definition: starpu_data_interfaces.h:257
starpu_block_interface::id
enum starpu_data_interface_id id
Definition: starpu_data_interfaces.h:1107
starpu_block_interface::elemsize
size_t elemsize
Definition: starpu_data_interfaces.h:1117
starpu_coo_interface::ny
uint32_t ny
Definition: starpu_data_interfaces.h:1019
starpu_data_copy_methods::mpi_ms_to_mpi_ms
int(* mpi_ms_to_mpi_ms)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:199
starpu_bcsr_interface::id
enum starpu_data_interface_id id
Definition: starpu_data_interfaces.h:1627
starpu_csr_interface::rowptr
uint32_t * rowptr
Definition: starpu_data_interfaces.h:1494
starpu_variable_interface::offset
size_t offset
Definition: starpu_data_interfaces.h:1391
starpu_data_copy_methods::ram_to_opencl
int(* ram_to_opencl)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
Definition: starpu_data_interfaces.h:122
starpu_matrix_interface::nx
uint32_t nx
Definition: starpu_data_interfaces.h:845
starpu_bcsr_interface::nzval
uintptr_t nzval
Definition: starpu_data_interfaces.h:1632
starpu_block_interface::nx
uint32_t nx
Definition: starpu_data_interfaces.h:1112
starpu_coo_interface::nx
uint32_t nx
Definition: starpu_data_interfaces.h:1018
starpu_data_interface_ops::allocate_data_on_node
starpu_ssize_t(* allocate_data_on_node)(void *data_interface, unsigned node)
Definition: starpu_data_interfaces.h:404
starpu_data_copy_methods::ram_to_opencl_async
int(* ram_to_opencl_async)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)
Definition: starpu_data_interfaces.h:247
starpu_data_interface_ops::copy_methods
const struct starpu_data_copy_methods * copy_methods
Definition: starpu_data_interfaces.h:428
starpu_data_handle_to_pointer
void * starpu_data_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
starpu_free_on_node_flags
void starpu_free_on_node_flags(unsigned dst_node, uintptr_t addr, size_t size, int flags)
starpu_vector_data_register_allocsize
void starpu_vector_data_register_allocsize(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t nx, size_t elemsize, size_t allocsize)
starpu_vector_get_nx
uint32_t starpu_vector_get_nx(starpu_data_handle_t handle)
starpu_data_register_same
void starpu_data_register_same(starpu_data_handle_t *handledst, starpu_data_handle_t handlesrc)
starpu_data_ptr_register
void starpu_data_ptr_register(starpu_data_handle_t handle, unsigned node)
starpu_matrix_ptr_register
void starpu_matrix_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset, uint32_t ld)
starpu_malloc_on_node_set_default_flags
void starpu_malloc_on_node_set_default_flags(unsigned node, int flags)
starpu_bcsr_data_register
void starpu_bcsr_data_register(starpu_data_handle_t *handle, int home_node, uint32_t nnz, uint32_t nrow, uintptr_t nzval, uint32_t *colind, uint32_t *rowptr, uint32_t firstentry, uint32_t r, uint32_t c, size_t elemsize)
starpu_matrix_data_register_allocsize
void starpu_matrix_data_register_allocsize(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t ld, uint32_t nx, uint32_t ny, size_t elemsize, size_t allocsize)
starpu_multiformat_data_register
void starpu_multiformat_data_register(starpu_data_handle_t *handle, int home_node, void *ptr, uint32_t nobjects, struct starpu_multiformat_data_interface_ops *format_ops)
starpu_vector_get_allocsize
size_t starpu_vector_get_allocsize(starpu_data_handle_t handle)
starpu_data_pointer_is_inside
int starpu_data_pointer_is_inside(starpu_data_handle_t handle, unsigned node, void *ptr)
starpu_csr_get_firstentry
uint32_t starpu_csr_get_firstentry(starpu_data_handle_t handle)
starpu_bcsr_get_elemsize
size_t starpu_bcsr_get_elemsize(starpu_data_handle_t handle)
starpu_vector_data_register
void starpu_vector_data_register(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t nx, size_t elemsize)
starpu_matrix_get_nx
uint32_t starpu_matrix_get_nx(starpu_data_handle_t handle)
starpu_block_get_elemsize
size_t starpu_block_get_elemsize(starpu_data_handle_t handle)
starpu_interface_copy3d
int starpu_interface_copy3d(uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t blocksize, size_t numblocks1, size_t ld1_src, size_t ld1_dst, size_t numblocks2, size_t ld2_src, size_t ld2_dst, void *async_data)
starpu_csr_get_local_nzval
uintptr_t starpu_csr_get_local_nzval(starpu_data_handle_t handle)
starpu_interface_start_driver_copy_async
void starpu_interface_start_driver_copy_async(unsigned src_node, unsigned dst_node, double *start)
starpu_variable_get_local_ptr
uintptr_t starpu_variable_get_local_ptr(starpu_data_handle_t handle)
starpu_bcsr_get_local_colind
uint32_t * starpu_bcsr_get_local_colind(starpu_data_handle_t handle)
starpu_matrix_get_local_ld
uint32_t starpu_matrix_get_local_ld(starpu_data_handle_t handle)
starpu_interface_end_driver_copy_async
void starpu_interface_end_driver_copy_async(unsigned src_node, unsigned dst_node, double start)
starpu_csr_get_nnz
uint32_t starpu_csr_get_nnz(starpu_data_handle_t handle)
starpu_block_get_local_ldz
uint32_t starpu_block_get_local_ldz(starpu_data_handle_t handle)
starpu_block_get_local_ptr
uintptr_t starpu_block_get_local_ptr(starpu_data_handle_t handle)
starpu_bcsr_get_c
uint32_t starpu_bcsr_get_c(starpu_data_handle_t handle)
starpu_interface_copy4d
int starpu_interface_copy4d(uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t blocksize, size_t numblocks1, size_t ld1_src, size_t ld1_dst, size_t numblocks2, size_t ld2_src, size_t ld2_dst, size_t numblocks3, size_t ld3_src, size_t ld3_dst, void *async_data)
starpu_matrix_get_ny
uint32_t starpu_matrix_get_ny(starpu_data_handle_t handle)
starpu_csr_get_nrow
uint32_t starpu_csr_get_nrow(starpu_data_handle_t handle)
starpu_data_lookup
starpu_data_handle_t starpu_data_lookup(const void *ptr)
starpu_csr_get_local_rowptr
uint32_t * starpu_csr_get_local_rowptr(starpu_data_handle_t handle)
starpu_interface_copy
int starpu_interface_copy(uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t size, void *async_data)
starpu_free_on_node
void starpu_free_on_node(unsigned dst_node, uintptr_t addr, size_t size)
starpu_data_register
void starpu_data_register(starpu_data_handle_t *handleptr, int home_node, void *data_interface, struct starpu_data_interface_ops *ops)
starpu_block_get_ny
uint32_t starpu_block_get_ny(starpu_data_handle_t handle)
starpu_matrix_data_register
void starpu_matrix_data_register(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t ld, uint32_t nx, uint32_t ny, size_t elemsize)
starpu_block_get_nx
uint32_t starpu_block_get_nx(starpu_data_handle_t handle)
starpu_bcsr_get_nnz
uint32_t starpu_bcsr_get_nnz(starpu_data_handle_t handle)
starpu_block_ptr_register
void starpu_block_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset, uint32_t ldy, uint32_t ldz)
starpu_bcsr_get_firstentry
uint32_t starpu_bcsr_get_firstentry(starpu_data_handle_t handle)
starpu_coo_data_register
void starpu_coo_data_register(starpu_data_handle_t *handleptr, int home_node, uint32_t nx, uint32_t ny, uint32_t n_values, uint32_t *columns, uint32_t *rows, uintptr_t values, size_t elemsize)
starpu_bcsr_get_local_rowptr
uint32_t * starpu_bcsr_get_local_rowptr(starpu_data_handle_t handle)
starpu_data_unpack
int starpu_data_unpack(starpu_data_handle_t handle, void *ptr, size_t count)
starpu_variable_get_elemsize
size_t starpu_variable_get_elemsize(starpu_data_handle_t handle)
starpu_matrix_get_allocsize
size_t starpu_matrix_get_allocsize(starpu_data_handle_t handle)
starpu_matrix_get_local_ptr
uintptr_t starpu_matrix_get_local_ptr(starpu_data_handle_t handle)
starpu_block_data_register
void starpu_block_data_register(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t ldy, uint32_t ldz, uint32_t nx, uint32_t ny, uint32_t nz, size_t elemsize)
starpu_data_interface_id
starpu_data_interface_id
Definition: starpu_data_interfaces.h:348
starpu_interface_data_copy
void starpu_interface_data_copy(unsigned src_node, unsigned dst_node, size_t size)
starpu_malloc_on_node_flags
uintptr_t starpu_malloc_on_node_flags(unsigned dst_node, size_t size, int flags)
starpu_csr_get_elemsize
size_t starpu_csr_get_elemsize(starpu_data_handle_t handle)
starpu_bcsr_get_nrow
uint32_t starpu_bcsr_get_nrow(starpu_data_handle_t handle)
starpu_data_get_interface_on_node
void * starpu_data_get_interface_on_node(starpu_data_handle_t handle, unsigned memory_node)
starpu_void_data_register
void starpu_void_data_register(starpu_data_handle_t *handle)
starpu_malloc_on_node
uintptr_t starpu_malloc_on_node(unsigned dst_node, size_t size)
starpu_csr_data_register
void starpu_csr_data_register(starpu_data_handle_t *handle, int home_node, uint32_t nnz, uint32_t nrow, uintptr_t nzval, uint32_t *colind, uint32_t *rowptr, uint32_t firstentry, size_t elemsize)
starpu_data_get_local_ptr
void * starpu_data_get_local_ptr(starpu_data_handle_t handle)
starpu_data_get_size
size_t starpu_data_get_size(starpu_data_handle_t handle)
starpu_data_get_alloc_size
size_t starpu_data_get_alloc_size(starpu_data_handle_t handle)
starpu_block_get_nz
uint32_t starpu_block_get_nz(starpu_data_handle_t handle)
starpu_vector_ptr_register
void starpu_vector_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset)
starpu_vector_get_elemsize
size_t starpu_vector_get_elemsize(starpu_data_handle_t handle)
starpu_vector_get_local_ptr
uintptr_t starpu_vector_get_local_ptr(starpu_data_handle_t handle)
starpu_interface_copy2d
int starpu_interface_copy2d(uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t blocksize, size_t numblocks, size_t ld_src, size_t ld_dst, void *async_data)
starpu_csr_get_local_colind
uint32_t * starpu_csr_get_local_colind(starpu_data_handle_t handle)
starpu_data_get_interface_id
enum starpu_data_interface_id starpu_data_get_interface_id(starpu_data_handle_t handle)
starpu_data_pack
int starpu_data_pack(starpu_data_handle_t handle, void **ptr, starpu_ssize_t *count)
starpu_bcsr_get_r
uint32_t starpu_bcsr_get_r(starpu_data_handle_t handle)
starpu_bcsr_get_local_nzval
uintptr_t starpu_bcsr_get_local_nzval(starpu_data_handle_t handle)
starpu_matrix_get_elemsize
size_t starpu_matrix_get_elemsize(starpu_data_handle_t handle)
starpu_block_get_local_ldy
uint32_t starpu_block_get_local_ldy(starpu_data_handle_t handle)
starpu_data_interface_get_next_id
int starpu_data_interface_get_next_id(void)
starpu_variable_ptr_register
void starpu_variable_ptr_register(starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset)
starpu_variable_data_register
void starpu_variable_data_register(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, size_t size)
STARPU_BCSR_INTERFACE_ID
@ STARPU_BCSR_INTERFACE_ID
Definition: starpu_data_interfaces.h:354
STARPU_MATRIX_INTERFACE_ID
@ STARPU_MATRIX_INTERFACE_ID
Definition: starpu_data_interfaces.h:350
STARPU_VARIABLE_INTERFACE_ID
@ STARPU_VARIABLE_INTERFACE_ID
Definition: starpu_data_interfaces.h:355
STARPU_VECTOR_INTERFACE_ID
@ STARPU_VECTOR_INTERFACE_ID
Definition: starpu_data_interfaces.h:352
STARPU_CSR_INTERFACE_ID
@ STARPU_CSR_INTERFACE_ID
Definition: starpu_data_interfaces.h:353
STARPU_UNKNOWN_INTERFACE_ID
@ STARPU_UNKNOWN_INTERFACE_ID
Definition: starpu_data_interfaces.h:349
STARPU_COO_INTERFACE_ID
@ STARPU_COO_INTERFACE_ID
Definition: starpu_data_interfaces.h:358
STARPU_MAX_INTERFACE_ID
@ STARPU_MAX_INTERFACE_ID
Definition: starpu_data_interfaces.h:359
STARPU_MULTIFORMAT_INTERFACE_ID
@ STARPU_MULTIFORMAT_INTERFACE_ID
Definition: starpu_data_interfaces.h:357
STARPU_VOID_INTERFACE_ID
@ STARPU_VOID_INTERFACE_ID
Definition: starpu_data_interfaces.h:356
STARPU_BLOCK_INTERFACE_ID
@ STARPU_BLOCK_INTERFACE_ID
Definition: starpu_data_interfaces.h:351
starpu_bcsr_interface
Definition: starpu_data_interfaces.h:1626
starpu_block_interface
Definition: starpu_data_interfaces.h:1106
starpu_coo_interface
Definition: starpu_data_interfaces.h:1012
starpu_csr_interface
Definition: starpu_data_interfaces.h:1487
starpu_data_copy_methods
Definition: starpu_data_interfaces.h:93
starpu_data_interface_ops
Definition: starpu_data_interfaces.h:366
starpu_matrix_interface
Definition: starpu_data_interfaces.h:840
starpu_multiformat_data_interface_ops
Definition: starpu_data_interfaces.h:1852
starpu_multiformat_interface
Definition: starpu_data_interfaces.h:1866
starpu_variable_interface
Definition: starpu_data_interfaces.h:1386
starpu_vector_interface
Definition: starpu_data_interfaces.h:1257
starpu_data_handle_t
struct _starpu_data_state * starpu_data_handle_t
Definition: starpu_data.h:44
starpu.h