StarPU Handbook

Data Structures | Enumerations
Data Interfaces

Data management is done at a high-level in StarPU: rather than accessing a mere list of contiguous buffers, the tasks may manipulate data that are described by a high-level construct which we call data interface. More...

## Data Structures
struct | starpu_data_copy_methods
struct | starpu_data_interface_ops
struct | starpu_matrix_interface
struct | starpu_coo_interface
struct | starpu_block_interface
struct | starpu_vector_interface
struct | starpu_variable_interface
struct | starpu_csr_interface
struct | starpu_bcsr_interface
struct | starpu_multiformat_data_interface_ops
struct | starpu_multiformat_interface

## Enumerations
enum | starpu_data_interface_id { STARPU_UNKNOWN_INTERFACE_ID , STARPU_MATRIX_INTERFACE_ID , STARPU_BLOCK_INTERFACE_ID , STARPU_VECTOR_INTERFACE_ID , STARPU_CSR_INTERFACE_ID , STARPU_BCSR_INTERFACE_ID , STARPU_VARIABLE_INTERFACE_ID , STARPU_VOID_INTERFACE_ID , STARPU_MULTIFORMAT_INTERFACE_ID , STARPU_COO_INTERFACE_ID , STARPU_MAX_INTERFACE_ID }

## Accessing Matrix Data Interfaces
struct starpu_data_interface_ops | starpu_interface_matrix_ops
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)
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)
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)
uint32_t | starpu_matrix_get_nx (starpu_data_handle_t handle)
uint32_t | starpu_matrix_get_ny (starpu_data_handle_t handle)
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)
size_t | starpu_matrix_get_allocsize (starpu_data_handle_t handle)
#define | STARPU_MATRIX_GET_PTR(interface)
#define | STARPU_MATRIX_GET_DEV_HANDLE(interface)
#define | STARPU_MATRIX_GET_OFFSET(interface)
#define | STARPU_MATRIX_GET_NX(interface)
#define | STARPU_MATRIX_GET_NY(interface)
#define | STARPU_MATRIX_GET_LD(interface)
#define | STARPU_MATRIX_GET_ELEMSIZE(interface)
#define | STARPU_MATRIX_GET_ALLOCSIZE(interface)
#define | STARPU_MATRIX_SET_NX(interface, newnx)
#define | STARPU_MATRIX_SET_NY(interface, newny)
#define | STARPU_MATRIX_SET_LD(interface, newld)

## Accessing COO Data Interfaces
struct starpu_data_interface_ops | starpu_interface_coo_ops
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)
#define | STARPU_COO_GET_COLUMNS(interface)
#define | STARPU_COO_GET_COLUMNS_DEV_HANDLE(interface)
#define | STARPU_COO_GET_ROWS(interface)
#define | STARPU_COO_GET_ROWS_DEV_HANDLE(interface)
#define | STARPU_COO_GET_VALUES(interface)
#define | STARPU_COO_GET_VALUES_DEV_HANDLE(interface)
#define | STARPU_COO_GET_OFFSET
#define | STARPU_COO_GET_NX(interface)
#define | STARPU_COO_GET_NY(interface)
#define | STARPU_COO_GET_NVALUES(interface)
#define | STARPU_COO_GET_ELEMSIZE(interface)

## Block Data Interface
struct starpu_data_interface_ops | starpu_interface_block_ops
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)
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)
uint32_t | starpu_block_get_nx (starpu_data_handle_t handle)
uint32_t | starpu_block_get_ny (starpu_data_handle_t handle)
uint32_t | starpu_block_get_nz (starpu_data_handle_t handle)
uint32_t | starpu_block_get_local_ldy (starpu_data_handle_t handle)
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)
#define | STARPU_BLOCK_GET_DEV_HANDLE(interface)
#define | STARPU_BLOCK_GET_OFFSET(interface)
#define | STARPU_BLOCK_GET_NX(interface)
#define | STARPU_BLOCK_GET_NY(interface)
#define | STARPU_BLOCK_GET_NZ(interface)
#define | STARPU_BLOCK_GET_LDY(interface)
#define | STARPU_BLOCK_GET_LDZ(interface)
#define | STARPU_BLOCK_GET_ELEMSIZE(interface)

## Vector Data Interface
struct starpu_data_interface_ops | starpu_interface_vector_ops
void | starpu_vector_data_register (starpu_data_handle_t *handle, int home_node, uintptr_t ptr, uint32_t nx, size_t elemsize)
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)
void | starpu_vector_ptr_register (starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset)
uint32_t | starpu_vector_get_nx (starpu_data_handle_t handle)
size_t | starpu_vector_get_elemsize (starpu_data_handle_t handle)
size_t | starpu_vector_get_allocsize (starpu_data_handle_t handle)
uintptr_t | starpu_vector_get_local_ptr (starpu_data_handle_t handle)
#define | STARPU_VECTOR_GET_PTR(interface)
#define | STARPU_VECTOR_GET_DEV_HANDLE(interface)
#define | STARPU_VECTOR_GET_OFFSET(interface)
#define | STARPU_VECTOR_GET_NX(interface)
#define | STARPU_VECTOR_GET_ELEMSIZE(interface)
#define | STARPU_VECTOR_GET_ALLOCSIZE(interface)
#define | STARPU_VECTOR_GET_SLICE_BASE(interface)
#define | STARPU_VECTOR_SET_NX(interface, newnx)

## Variable Data Interface
struct starpu_data_interface_ops | starpu_interface_variable_ops
void | starpu_variable_data_register (starpu_data_handle_t *handle, int home_node, uintptr_t ptr, size_t size)
void | starpu_variable_ptr_register (starpu_data_handle_t handle, unsigned node, uintptr_t ptr, uintptr_t dev_handle, size_t offset)
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)
#define | STARPU_VARIABLE_GET_OFFSET(interface)
#define | STARPU_VARIABLE_GET_ELEMSIZE(interface)
#define | STARPU_VARIABLE_GET_DEV_HANDLE(interface)

## Void Data Interface
struct starpu_data_interface_ops | starpu_interface_void_ops
void | starpu_void_data_register (starpu_data_handle_t *handle)

## CSR Data Interface
struct starpu_data_interface_ops | starpu_interface_csr_ops
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)
uint32_t | starpu_csr_get_nnz (starpu_data_handle_t handle)
uint32_t | starpu_csr_get_nrow (starpu_data_handle_t handle)
uint32_t | starpu_csr_get_firstentry (starpu_data_handle_t handle)
uintptr_t | starpu_csr_get_local_nzval (starpu_data_handle_t handle)
uint32_t * | starpu_csr_get_local_colind (starpu_data_handle_t handle)
uint32_t * | starpu_csr_get_local_rowptr (starpu_data_handle_t handle)
size_t | starpu_csr_get_elemsize (starpu_data_handle_t handle)
#define | STARPU_CSR_GET_NNZ(interface)
#define | STARPU_CSR_GET_NROW(interface)
#define | STARPU_CSR_GET_NZVAL(interface)
#define | STARPU_CSR_GET_NZVAL_DEV_HANDLE(interface)
#define | STARPU_CSR_GET_COLIND(interface)
#define | STARPU_CSR_GET_COLIND_DEV_HANDLE(interface)
#define | STARPU_CSR_GET_ROWPTR(interface)
#define | STARPU_CSR_GET_ROWPTR_DEV_HANDLE(interface)
#define | STARPU_CSR_GET_OFFSET
#define | STARPU_CSR_GET_FIRSTENTRY(interface)
#define | STARPU_CSR_GET_ELEMSIZE(interface)

## BCSR Data Interface
struct starpu_data_interface_ops | starpu_interface_bcsr_ops
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)
uint32_t | starpu_bcsr_get_nnz (starpu_data_handle_t handle)
uint32_t | starpu_bcsr_get_nrow (starpu_data_handle_t handle)
uint32_t | starpu_bcsr_get_firstentry (starpu_data_handle_t handle)
uintptr_t | starpu_bcsr_get_local_nzval (starpu_data_handle_t handle)
uint32_t * | starpu_bcsr_get_local_colind (starpu_data_handle_t handle)
uint32_t * | starpu_bcsr_get_local_rowptr (starpu_data_handle_t handle)
uint32_t | starpu_bcsr_get_r (starpu_data_handle_t handle)
uint32_t | starpu_bcsr_get_c (starpu_data_handle_t handle)
size_t | starpu_bcsr_get_elemsize (starpu_data_handle_t handle)
#define | STARPU_BCSR_GET_NNZ(interface)
#define | STARPU_BCSR_GET_NROW(interface)
#define | STARPU_BCSR_GET_NZVAL(interface)
#define | STARPU_BCSR_GET_NZVAL_DEV_HANDLE(interface)
#define | STARPU_BCSR_GET_COLIND(interface)
#define | STARPU_BCSR_GET_COLIND_DEV_HANDLE(interface)
#define | STARPU_BCSR_GET_ROWPTR(interface)
#define | STARPU_BCSR_GET_ROWPTR_DEV_HANDLE(interface)
#define | STARPU_BCSR_GET_FIRSTENTRY(interface)
#define | STARPU_BCSR_GET_R(interface)
#define | STARPU_BCSR_GET_C(interface)
#define | STARPU_BCSR_GET_ELEMSIZE(interface)
#define | STARPU_BCSR_GET_OFFSET

## Basic API
void | starpu_data_register (starpu_data_handle_t *handleptr, int home_node, void *data_interface, struct starpu_data_interface_ops *ops)
void | starpu_data_ptr_register (starpu_data_handle_t handle, unsigned node)
void | starpu_data_register_same (starpu_data_handle_t *handledst, starpu_data_handle_t handlesrc)
void * | starpu_data_handle_to_pointer (starpu_data_handle_t handle, unsigned node)
int | starpu_data_pointer_is_inside (starpu_data_handle_t handle, unsigned node, void *ptr)
void * | starpu_data_get_local_ptr (starpu_data_handle_t handle)
void * | starpu_data_get_interface_on_node (starpu_data_handle_t handle, unsigned memory_node)
enum starpu_data_interface_id | starpu_data_get_interface_id (starpu_data_handle_t handle)
int | starpu_data_pack (starpu_data_handle_t handle, void **ptr, starpu_ssize_t *count)
int | starpu_data_unpack (starpu_data_handle_t handle, void *ptr, size_t count)
size_t | starpu_data_get_size (starpu_data_handle_t handle)
size_t | starpu_data_get_alloc_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)
int | starpu_data_interface_get_next_id (void)
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)
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)
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)
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)
void | starpu_interface_start_driver_copy_async (unsigned src_node, unsigned dst_node, double *start)
void | starpu_interface_end_driver_copy_async (unsigned src_node, unsigned dst_node, double start)
void | starpu_interface_data_copy (unsigned src_node, unsigned dst_node, size_t size)
uintptr_t | starpu_malloc_on_node_flags (unsigned dst_node, size_t size, int flags)
uintptr_t | starpu_malloc_on_node (unsigned dst_node, size_t size)
void | starpu_free_on_node_flags (unsigned dst_node, uintptr_t addr, size_t size, int flags)
void | starpu_free_on_node (unsigned dst_node, uintptr_t addr, size_t size)
void | starpu_malloc_on_node_set_default_flags (unsigned node, int flags)

## Multiformat Data Interface
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)
#define | STARPU_MULTIFORMAT_GET_CPU_PTR(interface)
#define | STARPU_MULTIFORMAT_GET_CUDA_PTR(interface)
#define | STARPU_MULTIFORMAT_GET_OPENCL_PTR(interface)
#define | STARPU_MULTIFORMAT_GET_MIC_PTR(interface)
#define | STARPU_MULTIFORMAT_GET_NX(interface)
uint32_t | starpu_hash_crc32c_be_n (const void *input, size_t n, uint32_t inputcrc)
uint32_t | starpu_hash_crc32c_be (uint32_t input, uint32_t inputcrc)
uint32_t | starpu_hash_crc32c_string (const char *str, uint32_t inputcrc)

## Detailed Description

Data management is done at a high-level in StarPU: rather than accessing a mere list of contiguous buffers, the tasks may manipulate data that are described by a high-level construct which we call data interface.

An example of data interface is the "vector" interface which describes a contiguous data array on a spefic memory node. This interface is a simple structure containing the number of elements in the array, the size of the elements, and the address of the array in the appropriate address space (this address may be invalid if there is no valid copy of the array in the memory node). More informations on the data interfaces provided by StarPU are given in Data Interfaces.

When a piece of data managed by StarPU is used by a task, the task implementation is given a pointer to an interface describing a valid copy of the data that is accessible from the current processing unit.

Every worker is associated to a memory node which is a logical abstraction of the address space from which the processing unit gets its data. For instance, the memory node associated to the different CPU workers represents main memory (RAM), the memory node associated to a GPU is DRAM embedded on the device. Every memory node is identified by a logical index which is accessible from the function starpu_worker_get_memory_node(). When registering a piece of data to StarPU, the specified memory node indicates where the piece of data initially resides (we also call this memory node the home node of a piece of data).

In the case of NUMA systems, functions starpu_memory_nodes_numa_devid_to_id() and starpu_memory_nodes_numa_id_to_devid() can be used to convert from NUMA node numbers as seen by the Operating System and NUMA node numbers as seen by StarPU.

There are several ways to register a memory region so that it can be managed by StarPU. StarPU provides data interfaces for vectors, 2D matrices, 3D matrices as well as BCSR and CSR sparse matrices.

Each data interface is provided with a set of field access functions. The ones using a `void *` parameter aimed to be used in codelet implementations (see for example the code in Vector Scaling).

Applications can provide their own interface as shown in Defining A New Data Interface.

## Data Structure Documentation

## ◆ starpu_data_copy_methods

struct starpu_data_copy_methods

Define the per-interface methods. If the starpu_data_copy_methods::any_to_any method is provided, it will be used by default if no specific method is provided. It can still be useful to provide more specific method in case of e.g. available particular CUDA or OpenCL support.

### Data Fields
int(* | can_copy )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, unsigned handling_node)
int(* | ram_to_ram )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | ram_to_cuda )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | ram_to_opencl )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | ram_to_mic )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | cuda_to_ram )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | cuda_to_cuda )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | cuda_to_opencl )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | opencl_to_ram )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | opencl_to_cuda )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | opencl_to_opencl )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | mic_to_ram )(void *src_interface, unsigned srd_node, void *dst_interface, unsigned dst_node)
int(* | ram_to_mpi_ms )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | mpi_ms_to_ram )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | mpi_ms_to_mpi_ms )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | ram_to_cuda_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream)
int(* | cuda_to_ram_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream)
int(* | cuda_to_cuda_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream)
int(* | ram_to_opencl_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)
int(* | opencl_to_ram_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)
int(* | opencl_to_opencl_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)
int(* | ram_to_mpi_ms_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *event)
int(* | mpi_ms_to_ram_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *event)
int(* | mpi_ms_to_mpi_ms_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *event)
int(* | ram_to_mic_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)
int(* | mic_to_ram_async )(void *src_interface, unsigned srd_node, void *dst_interface, unsigned dst_node)
int(* | any_to_any )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *async_data)

#### Field Documentation

## ◆ can_copy

int(* starpu_data_copy_methods::can_copy) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, unsigned handling_node)

If defined, allow the interface to declare whether it supports transferring from `src_interface` on node `src_node` to `dst_interface` on node `dst_node`, run from node `handling_node`. If not defined, it is assumed that the interface supports all transfers.

## ◆ ram_to_ram

int(* starpu_data_copy_methods::ram_to_ram) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` CPU node to the `dst_interface` interface on the `dst_node` CPU node. Return 0 on success.

## ◆ ram_to_cuda

int(* starpu_data_copy_methods::ram_to_cuda) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` CPU node to the `dst_interface` interface on the `dst_node` CUDA node. Return 0 on success.

## ◆ ram_to_opencl

int(* starpu_data_copy_methods::ram_to_opencl) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` CPU node to the `dst_interface` interface on the `dst_node` OpenCL node. Return 0 on success.

## ◆ ram_to_mic

int(* starpu_data_copy_methods::ram_to_mic) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` CPU node to the `dst_interface` interface on the `dst_node` MIC node. Return 0 on success.

## ◆ cuda_to_ram

int(* starpu_data_copy_methods::cuda_to_ram) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` CUDA node to the `dst_interface` interface on the `dst_node` CPU node. Return 0 on success.

## ◆ cuda_to_cuda

int(* starpu_data_copy_methods::cuda_to_cuda) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` CUDA node to the `dst_interface` interface on the `dst_node` CUDA node. Return 0 on success.

## ◆ cuda_to_opencl

int(* starpu_data_copy_methods::cuda_to_opencl) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` CUDA node to the `dst_interface` interface on the `dst_node` OpenCL node. Return 0 on success.

## ◆ opencl_to_ram

int(* starpu_data_copy_methods::opencl_to_ram) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` OpenCL node to the `dst_interface` interface on the `dst_node` CPU node. Return 0 on success.

## ◆ opencl_to_cuda

int(* starpu_data_copy_methods::opencl_to_cuda) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` OpenCL node to the `dst_interface` interface on the `dst_node` CUDA node. Return 0 on success.

## ◆ opencl_to_opencl

int(* starpu_data_copy_methods::opencl_to_opencl) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` OpenCL node to the `dst_interface` interface on the `dst_node` OpenCL node. Return 0 on success.

## ◆ mic_to_ram

int(* starpu_data_copy_methods::mic_to_ram) (void *src_interface, unsigned srd_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` MIC node to the `dst_interface` interface on the `dst_node` CPU node. Return 0 on success.

## ◆ ram_to_mpi_ms

int(* starpu_data_copy_methods::ram_to_mpi_ms) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` CPU node to the `dst_interface` interface on the `dst_node` MPI Slave node. Return 0 on success.

## ◆ mpi_ms_to_ram

int(* starpu_data_copy_methods::mpi_ms_to_ram) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` MPI Slave node to the `dst_interface` interface on the `dst_node` CPU node. Return 0 on success.

## ◆ mpi_ms_to_mpi_ms

int(* starpu_data_copy_methods::mpi_ms_to_mpi_ms) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` MPI Slave node to the `dst_interface` interface on the `dst_node` MPI Slave node. Return 0 on success.

## ◆ ram_to_cuda_async

int(* starpu_data_copy_methods::ram_to_cuda_async) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream)

Define how to copy data from the `src_interface` interface on the `src_node` CPU node to the `dst_interface` interface on the `dst_node` CUDA node, using the given stream. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ cuda_to_ram_async

int(* starpu_data_copy_methods::cuda_to_ram_async) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream)

Define how to copy data from the `src_interface` interface on the `src_node` CUDA node to the `dst_interface` interface on the `dst_node` CPU node, using the given stream. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ cuda_to_cuda_async

int(* starpu_data_copy_methods::cuda_to_cuda_async) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, starpu_cudaStream_t stream)

Define how to copy data from the `src_interface` interface on the `src_node` CUDA node to the `dst_interface` interface on the `dst_node` CUDA node, using the given stream. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ ram_to_opencl_async

int(* starpu_data_copy_methods::ram_to_opencl_async) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)

Define how to copy data from the `src_interface` interface on the `src_node` CPU node to the `dst_interface` interface on the `dst_node` OpenCL node, by recording in `event`, a pointer to a `cl_event`, the event of the last submitted transfer. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ opencl_to_ram_async

int(* starpu_data_copy_methods::opencl_to_ram_async) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)

Define how to copy data from the `src_interface` interface on the `src_node` OpenCL node to the `dst_interface` interface on the `dst_node` CPU node, by recording in `event`, a pointer to a `cl_event`, the event of the last submitted transfer. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ opencl_to_opencl_async

int(* starpu_data_copy_methods::opencl_to_opencl_async) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cl_event *event)

Define how to copy data from the `src_interface` interface on the `src_node` OpenCL node to the `dst_interface` interface on the `dst_node` OpenCL node, by recording in `event`, a pointer to a `cl_event`, the event of the last submitted transfer. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ ram_to_mpi_ms_async

int(* starpu_data_copy_methods::ram_to_mpi_ms_async) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *event)

Define how to copy data from the `src_interface` interface on the `src_node` CPU node to the `dst_interface` interface on the `dst_node` MPI Slave node, with the given even. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ mpi_ms_to_ram_async

int(* starpu_data_copy_methods::mpi_ms_to_ram_async) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *event)

Define how to copy data from the `src_interface` interface on the `src_node` MPI Slave node to the `dst_interface` interface on the `dst_node` CPU node, with the given event. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ mpi_ms_to_mpi_ms_async

int(* starpu_data_copy_methods::mpi_ms_to_mpi_ms_async) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *event)

Define how to copy data from the `src_interface` interface on the `src_node` MPI Slave node to the `dst_interface` interface on the `dst_node` MPI Slave node, using the given stream. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ ram_to_mic_async

int(* starpu_data_copy_methods::ram_to_mic_async) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` CPU node to the `dst_interface` interface on the `dst_node` MIC node. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ mic_to_ram_async

int(* starpu_data_copy_methods::mic_to_ram_async) (void *src_interface, unsigned srd_node, void *dst_interface, unsigned dst_node)

Define how to copy data from the `src_interface` interface on the `src_node` MIC node to the `dst_interface` interface on the `dst_node` CPU node. Must return 0 if the transfer was actually completed completely synchronously, or `-EAGAIN` if at least some transfers are still ongoing and should be awaited for by the core.

## ◆ any_to_any

int(* starpu_data_copy_methods::any_to_any) (void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *async_data)

Define how to copy data from the `src_interface` interface on the `src_node` node to the `dst_interface` interface on the `dst_node` node. This is meant to be implemented through the starpu_interface_copy() helper, to which async_data should be passed as such, and will be used to manage asynchronicity. This must return `-EAGAIN` if any of the starpu_interface_copy() calls has returned `-EAGAIN` (i.e. at least some transfer is still ongoing), and return 0 otherwise.

This can only be implemented if the interface has ready-to-send data blocks. If the interface is more involved than this, i.e. it needs to collect pieces of data before transferring, starpu_data_interface_ops::pack_data and starpu_data_interface_ops::unpack_data should be implemented instead, and the core will just transfer the resulting data buffer.

## ◆ starpu_data_interface_ops

struct starpu_data_interface_ops

Per-interface data management methods.

### Data Fields
void(* | register_data_handle )(starpu_data_handle_t handle, unsigned home_node, void *data_interface)
void(* | unregister_data_handle )(starpu_data_handle_t handle)
starpu_ssize_t(* | allocate_data_on_node )(void *data_interface, unsigned node)
void(* | free_data_on_node )(void *data_interface, unsigned node)
void(* | init )(void *data_interface)
const struct starpu_data_copy_methods * | copy_methods
void *(* | handle_to_pointer )(starpu_data_handle_t handle, unsigned node)
void *(* | to_pointer )(void *data_interface, unsigned node)
int(* | pointer_is_inside )(void *data_interface, unsigned node, void *ptr)
size_t(* | get_size )(starpu_data_handle_t handle)
size_t(* | get_alloc_size )(starpu_data_handle_t handle)
uint32_t(* | footprint )(starpu_data_handle_t handle)
uint32_t(* | alloc_footprint )(starpu_data_handle_t handle)
int(* | compare )(void *data_interface_a, void *data_interface_b)
int(* | alloc_compare )(void *data_interface_a, void *data_interface_b)
void(* | display )(starpu_data_handle_t handle, FILE *f)
starpu_ssize_t(* | describe )(void *data_interface, char *buf, size_t size)
enum starpu_data_interface_id | interfaceid
size_t | interface_size
char | is_multiformat
char | dontcache
struct starpu_multiformat_data_interface_ops *(* | get_mf_ops )(void *data_interface)
int(* | pack_data )(starpu_data_handle_t handle, unsigned node, void **ptr, starpu_ssize_t *count)
int(* | unpack_data )(starpu_data_handle_t handle, unsigned node, void *ptr, size_t count)
char * | name

#### Field Documentation

## ◆ register_data_handle

void(* starpu_data_interface_ops::register_data_handle) (starpu_data_handle_t handle, unsigned home_node, void *data_interface)

Register an existing interface into a data handle.

This iterates over all memory nodes to initialize all fields of the data interface on each of them. Since data is not allocated yet except on the home node, pointers should be left as NULL except on the `home_node`, for which the pointers should be copied from the given `data_interface`, which was filled with the application's pointers.

This method is mandatory.

## ◆ unregister_data_handle

void(* starpu_data_interface_ops::unregister_data_handle) (starpu_data_handle_t handle)

Unregister a data handle.

This iterates over all memory nodes to free any pointer in the data interface on each of them.

At this point, free_data_on_node has been already called on each of them. This just clears anything that would still be left.

## ◆ allocate_data_on_node

starpu_ssize_t(* starpu_data_interface_ops::allocate_data_on_node) (void *data_interface, unsigned node)

Allocate data for the interface on a given node. This should use starpu_malloc_on_node() to perform the allocation(s), and fill the pointers in the data interface. It should return the size of the allocated memory, or -ENOMEM if memory could not be allocated.

Note that the memory node can be CPU memory, GPU memory, or even disk area. The result returned by starpu_malloc_on_node() should be just stored as uintptr_t without trying to interpret it since it may be a GPU pointer, a disk descriptor, etc.

This method is mandatory to be able to support memory nodes.

## ◆ free_data_on_node

void(* starpu_data_interface_ops::free_data_on_node) (void *data_interface, unsigned node)

Free data of the interface on a given node.

This method is mandatory to be able to support memory nodes.

## ◆ init

void(* starpu_data_interface_ops::init) (void *data_interface)

Initialize the interface. This method is optional. It is called when initializing the handler on all the memory nodes.

## ◆ copy_methods

const struct starpu_data_copy_methods* starpu_data_interface_ops::copy_methods

Struct with pointer to functions for performing ram/cuda/opencl synchronous and asynchronous transfers.

This field is mandatory to be able to support memory nodes, except disk nodes which can be supported by just implementing starpu_data_interface_ops::pack_data and starpu_data_interface_ops::unpack_data.

## ◆ handle_to_pointer

void *(* starpu_data_interface_ops::handle_to_pointer) (starpu_data_handle_t handle, unsigned node)

Deprecated:
  Use starpu_data_interface_ops::to_pointer instead. Return the current pointer (if any) for the handle on the given node.

This method is only required if starpu_data_interface_ops::to_pointer is not implemented.

## ◆ to_pointer

void *(* starpu_data_interface_ops::to_pointer) (void *data_interface, unsigned node)

Return the current pointer (if any) for the given interface on the given node.

This method is only required for starpu_data_handle_to_pointer() and starpu_data_get_local_ptr(), and for disk support.

## ◆ pointer_is_inside

int(* starpu_data_interface_ops::pointer_is_inside) (void *data_interface, unsigned node, void *ptr)

Return whether the given `ptr` is within the data for the given interface on the given node. This method is optional, as it is only used for coherency checks.

## ◆ get_size

size_t(* starpu_data_interface_ops::get_size) (starpu_data_handle_t handle)

Return an estimation of the size of data, for performance models and tracing feedback.

## ◆ get_alloc_size

size_t(* starpu_data_interface_ops::get_alloc_size) (starpu_data_handle_t handle)

Return an estimation of the size of allocated data, for allocation management. If not specified, the starpu_data_interface_ops::get_size method is used instead.

## ◆ footprint

uint32_t(* starpu_data_interface_ops::footprint) (starpu_data_handle_t handle)

Return a 32bit footprint which characterizes the data size and layout (nx, ny, ld, elemsize, etc.), required for indexing performance models.

starpu_hash_crc32c_be() and alike can be used to produce this 32bit value from various types of values.

## ◆ alloc_footprint

uint32_t(* starpu_data_interface_ops::alloc_footprint) (starpu_data_handle_t handle)

Return a 32bit footprint which characterizes the data allocation, to be used for indexing allocation cache. If not specified, the starpu_data_interface_ops::footprint method is used instead.

## ◆ compare

int(* starpu_data_interface_ops::compare) (void *data_interface_a, void *data_interface_b)

Compare the data size and layout of two interfaces (nx, ny, ld, elemsize, etc.), to be used for indexing performance models. It should return 1 if the two interfaces size and layout match computation-wise, and 0 otherwise. It does *not* compare the actual content of the interfaces.

## ◆ alloc_compare

int(* starpu_data_interface_ops::alloc_compare) (void *data_interface_a, void *data_interface_b)

Compare the data allocation of two interfaces etc.), to be used for indexing allocation cache. It should return 1 if the two interfaces are allocation-compatible, i.e. basically have the same alloc_size, and 0 otherwise. If not specified, the starpu_data_interface_ops::compare method is used instead.

## ◆ display

void(* starpu_data_interface_ops::display) (starpu_data_handle_t handle, FILE *f)

Dump the sizes of a handle to a file. This is required for performance models

## ◆ describe

starpu_ssize_t(* starpu_data_interface_ops::describe) (void *data_interface, char *buf, size_t size)

Describe the data into a string in a brief way, such as one letter to describe the type of data, and the data dimensions. This is required for tracing feedback.

## ◆ interfaceid

enum starpu_data_interface_id starpu_data_interface_ops::interfaceid

An identifier that is unique to each interface.

## ◆ interface_size

size_t starpu_data_interface_ops::interface_size

Size of the interface data descriptor.

## ◆ dontcache

char starpu_data_interface_ops::dontcache

If set to non-zero, StarPU will never try to reuse an allocated buffer for a different handle. This can be notably useful for application-defined interfaces which have a dynamic size, and for which it thus does not make sense to reuse the buffer since will probably not have the proper size.

## ◆ pack_data

int(* starpu_data_interface_ops::pack_data) (starpu_data_handle_t handle, unsigned node, void **ptr, starpu_ssize_t *count)

Pack the data handle into a contiguous buffer at the address allocated with `starpu_malloc_flags(ptr, size, 0)` (and thus returned in `ptr`) and set the size of the newly created buffer in `count`. If `ptr` is `NULL`, the function should not copy the data in the buffer but just set count to the size of the buffer which would have been allocated. The special value -1 indicates the size is yet unknown.

This method (and starpu_data_interface_ops::unpack_data) is required for disk support if the starpu_data_copy_methods::any_to_any method is not implemented (because the in-memory data layout is too complex).

This is also required for MPI support if there is no registered MPI data type.

## ◆ unpack_data

int(* starpu_data_interface_ops::unpack_data) (starpu_data_handle_t handle, unsigned node, void *ptr, size_t count)

Unpack the data handle from the contiguous buffer at the address `ptr` of size `count`. The memory at the address `ptr` should be freed after the data unpacking operation.

## ◆ name

char* starpu_data_interface_ops::name

Name of the interface

## ◆ starpu_matrix_interface

struct starpu_matrix_interface

Matrix interface for dense matrices

Data Fields
enum starpu_data_interface_id | id | Identifier of the interface
uintptr_t | ptr | local pointer of the matrix
uintptr_t | dev_handle | device handle of the matrix
size_t | offset | offset in the matrix
uint32_t | nx | number of elements on the x-axis of the matrix
uint32_t | ny | number of elements on the y-axis of the matrix
uint32_t | ld | number of elements between each row of the matrix. Maybe be equal to starpu_matrix_interface::nx when there is no padding.
size_t | elemsize | size of the elements of the matrix
size_t | allocsize | size actually currently allocated

## ◆ starpu_coo_interface

struct starpu_coo_interface

COO Matrices

Data Fields
enum starpu_data_interface_id | id | identifier of the interface
uint32_t * | columns | column array of the matrix
uint32_t * | rows | row array of the matrix
uintptr_t | values | values of the matrix
uint32_t | nx | number of elements on the x-axis of the matrix
uint32_t | ny | number of elements on the y-axis of the matrix
uint32_t | n_values | number of values registered in the matrix
size_t | elemsize | size of the elements of the matrix

## ◆ starpu_block_interface

struct starpu_block_interface

Block interface for 3D dense blocks

Data Fields
enum starpu_data_interface_id | id | identifier of the interface
uintptr_t | ptr | local pointer of the block
uintptr_t | dev_handle | device handle of the block.
size_t | offset | offset in the block.
uint32_t | nx | number of elements on the x-axis of the block.
uint32_t | ny | number of elements on the y-axis of the block.
uint32_t | nz | number of elements on the z-axis of the block.
uint32_t | ldy | number of elements between two lines
uint32_t | ldz | number of elements between two planes
size_t | elemsize | size of the elements of the block.

## ◆ starpu_vector_interface

struct starpu_vector_interface

Data Fields
enum starpu_data_interface_id | id | Identifier of the interface
uintptr_t | ptr | local pointer of the vector
uintptr_t | dev_handle | device handle of the vector.
size_t | offset | offset in the vector
uint32_t | nx | number of elements on the x-axis of the vector
size_t | elemsize | size of the elements of the vector
uint32_t | slice_base | vector slice base, used by the StarPU OpenMP runtime support
size_t | allocsize | size actually currently allocated

## ◆ starpu_variable_interface

struct starpu_variable_interface

Variable interface for a single data (not a vector, a matrix, a list, ...)

Data Fields
enum starpu_data_interface_id | id | Identifier of the interface
uintptr_t | ptr | local pointer of the variable
uintptr_t | dev_handle | device handle of the variable.
size_t | offset | offset in the variable
size_t | elemsize | size of the variable

## ◆ starpu_csr_interface

struct starpu_csr_interface

CSR interface for sparse matrices (compressed sparse row representation)

Data Fields
enum starpu_data_interface_id | id | Identifier of the interface
uint32_t | nnz | number of non-zero entries
uint32_t | nrow | number of rows
uintptr_t | nzval | non-zero values
uint32_t * | colind | position of non-zero entries on the row
uint32_t * | rowptr | index (in nzval) of the first entry of the row
uint32_t | firstentry | k for k-based indexing (0 or 1 usually). also useful when partitionning the matrix.
size_t | elemsize | size of the elements of the matrix

## ◆ starpu_bcsr_interface

struct starpu_bcsr_interface

BCSR interface for sparse matrices (blocked compressed sparse row representation)

Note: when a BCSR matrix is partitioned, nzval, colind, and rowptr point into the corresponding father arrays. The rowptr content is thus the same as the father's. Firstentry is used to offset this so it becomes valid for the child arrays.

Data Fields
enum starpu_data_interface_id | id | Identifier of the interface
uint32_t | nnz | number of non-zero BLOCKS
uint32_t | nrow | number of rows (in terms of BLOCKS)
uintptr_t | nzval | non-zero values: nnz blocks of r*c elements
uint32_t * | colind | array of nnz elements, colind[i] is the block-column index for block i in nzval
uint32_t * | rowptr | array of nrow+1 elements, rowptr[i] is the block-index (in nzval) of the first block of row i. By convention, rowptr[nrow] is the number of blocks, this allows an easier access of the matrix's elements for the kernels.
uint32_t | firstentry | k for k-based indexing (0 or 1 usually). Also useful when partitionning the matrix.
uint32_t | r | height of the blocks
uint32_t | c | width of the blocks
size_t | elemsize | size of the elements of the matrix

## ◆ starpu_multiformat_data_interface_ops

struct starpu_multiformat_data_interface_ops

Multiformat operations

Data Fields
size_t | cpu_elemsize | size of each element on CPUs
size_t | opencl_elemsize | size of each element on OpenCL devices
struct starpu_codelet * | cpu_to_opencl_cl | pointer to a codelet which converts from CPU to OpenCL
struct starpu_codelet * | opencl_to_cpu_cl | pointer to a codelet which converts from OpenCL to CPU
size_t | cuda_elemsize | size of each element on CUDA devices
struct starpu_codelet * | cpu_to_cuda_cl | pointer to a codelet which converts from CPU to CUDA
struct starpu_codelet * | cuda_to_cpu_cl | pointer to a codelet which converts from CUDA to CPU
size_t | mic_elemsize | size of each element on MIC devices
struct starpu_codelet * | cpu_to_mic_cl | pointer to a codelet which converts from CPU to MIC
struct starpu_codelet * | mic_to_cpu_cl | pointer to a codelet which converts from MIC to CPU

## ◆ starpu_multiformat_interface

struct starpu_multiformat_interface

Data Fields
enum starpu_data_interface_id | id |
void * | cpu_ptr |
void * | cuda_ptr |
void * | opencl_ptr |
void * | mic_ptr |
uint32_t | nx |
struct starpu_multiformat_data_interface_ops * | ops |

## Macro Definition Documentation

## ◆ STARPU_MATRIX_GET_PTR

#define STARPU_MATRIX_GET_PTR | ( |  | interface | ) |

Return a pointer to the matrix designated by `interface`, valid on CPUs and CUDA devices only. For OpenCL devices, the device handle and offset need to be used instead.

## ◆ STARPU_MATRIX_GET_DEV_HANDLE

#define STARPU_MATRIX_GET_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the matrix designated by `interface`, to be used with OpenCL. The offset returned by STARPU_MATRIX_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_MATRIX_GET_OFFSET

#define STARPU_MATRIX_GET_OFFSET | ( |  | interface | ) |

Return the offset in the matrix designated by `interface`, to be used with the device handle.

## ◆ STARPU_MATRIX_GET_NX

#define STARPU_MATRIX_GET_NX | ( |  | interface | ) |

Return the number of elements on the x-axis of the matrix designated by `interface`.

## ◆ STARPU_MATRIX_GET_NY

#define STARPU_MATRIX_GET_NY | ( |  | interface | ) |

Return the number of elements on the y-axis of the matrix designated by `interface`.

## ◆ STARPU_MATRIX_GET_LD

#define STARPU_MATRIX_GET_LD | ( |  | interface | ) |

Return the number of elements between each row of the matrix designated by `interface`. May be equal to nx when there is no padding.

## ◆ STARPU_MATRIX_GET_ELEMSIZE

#define STARPU_MATRIX_GET_ELEMSIZE | ( |  | interface | ) |

Return the size of the elements registered into the matrix designated by `interface`.

## ◆ STARPU_MATRIX_GET_ALLOCSIZE

#define STARPU_MATRIX_GET_ALLOCSIZE | ( |  | interface | ) |

Return the allocated size of the matrix designated by `interface`.

## ◆ STARPU_MATRIX_SET_NX

#define STARPU_MATRIX_SET_NX | ( |  | interface,
|  |  | newnx
| ) |  |

Set the number of elements on the x-axis of the matrix designated by `interface`.

## ◆ STARPU_MATRIX_SET_NY

#define STARPU_MATRIX_SET_NY | ( |  | interface,
|  |  | newny
| ) |  |

Set the number of elements on the y-axis of the matrix designated by `interface`.

## ◆ STARPU_MATRIX_SET_LD

#define STARPU_MATRIX_SET_LD | ( |  | interface,
|  |  | newld
| ) |  |

Set the number of elements between each row of the matrix designated by `interface`. May be set to the same value as nx when there is no padding.

## ◆ STARPU_COO_GET_COLUMNS

#define STARPU_COO_GET_COLUMNS | ( |  | interface | ) |

Return a pointer to the column array of the matrix designated by `interface`.

## ◆ STARPU_COO_GET_COLUMNS_DEV_HANDLE

#define STARPU_COO_GET_COLUMNS_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the column array of the matrix designated by `interface`, to be used with OpenCL. The offset returned by STARPU_COO_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_COO_GET_ROWS

#define STARPU_COO_GET_ROWS | ( |  | interface | ) |

Return a pointer to the rows array of the matrix designated by `interface`.

## ◆ STARPU_COO_GET_ROWS_DEV_HANDLE

#define STARPU_COO_GET_ROWS_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the row array of the matrix designated by `interface`, to be used on OpenCL. The offset returned by STARPU_COO_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_COO_GET_VALUES

#define STARPU_COO_GET_VALUES | ( |  | interface | ) |

Return a pointer to the values array of the matrix designated by `interface`.

## ◆ STARPU_COO_GET_VALUES_DEV_HANDLE

#define STARPU_COO_GET_VALUES_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the value array of the matrix designated by `interface`, to be used on OpenCL. The offset returned by STARPU_COO_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_COO_GET_OFFSET

#define STARPU_COO_GET_OFFSET

Return the offset in the arrays of the COO matrix designated by `interface`.

## ◆ STARPU_COO_GET_NX

#define STARPU_COO_GET_NX | ( |  | interface | ) |

Return the number of elements on the x-axis of the matrix designated by `interface`.

## ◆ STARPU_COO_GET_NY

#define STARPU_COO_GET_NY | ( |  | interface | ) |

Return the number of elements on the y-axis of the matrix designated by `interface`.

## ◆ STARPU_COO_GET_NVALUES

#define STARPU_COO_GET_NVALUES | ( |  | interface | ) |

Return the number of values registered in the matrix designated by `interface`.

## ◆ STARPU_COO_GET_ELEMSIZE

#define STARPU_COO_GET_ELEMSIZE | ( |  | interface | ) |

Return the size of the elements registered into the matrix designated by `interface`.

## ◆ STARPU_BLOCK_GET_PTR

#define STARPU_BLOCK_GET_PTR | ( |  | interface | ) |

Return a pointer to the block designated by `interface`.

## ◆ STARPU_BLOCK_GET_DEV_HANDLE

#define STARPU_BLOCK_GET_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the block designated by `interface`, to be used on OpenCL. The offset returned by STARPU_BLOCK_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_BLOCK_GET_OFFSET

#define STARPU_BLOCK_GET_OFFSET | ( |  | interface | ) |

Return the offset in the block designated by `interface`, to be used with the device handle.

## ◆ STARPU_BLOCK_GET_NX

#define STARPU_BLOCK_GET_NX | ( |  | interface | ) |

Return the number of elements on the x-axis of the block designated by `interface`.

## ◆ STARPU_BLOCK_GET_NY

#define STARPU_BLOCK_GET_NY | ( |  | interface | ) |

Return the number of elements on the y-axis of the block designated by `interface`.

## ◆ STARPU_BLOCK_GET_NZ

#define STARPU_BLOCK_GET_NZ | ( |  | interface | ) |

Return the number of elements on the z-axis of the block designated by `interface`.

## ◆ STARPU_BLOCK_GET_LDY

#define STARPU_BLOCK_GET_LDY | ( |  | interface | ) |

Return the number of elements between each row of the block designated by `interface`. May be equal to nx when there is no padding.

## ◆ STARPU_BLOCK_GET_LDZ

#define STARPU_BLOCK_GET_LDZ | ( |  | interface | ) |

Return the number of elements between each z plane of the block designated by `interface`. May be equal to nx*ny when there is no padding.

## ◆ STARPU_BLOCK_GET_ELEMSIZE

#define STARPU_BLOCK_GET_ELEMSIZE | ( |  | interface | ) |

Return the size of the elements of the block designated by `interface`.

## ◆ STARPU_VECTOR_GET_PTR

#define STARPU_VECTOR_GET_PTR | ( |  | interface | ) |

Return a pointer to the array designated by `interface`, valid on CPUs and CUDA only. For OpenCL, the device handle and offset need to be used instead.

## ◆ STARPU_VECTOR_GET_DEV_HANDLE

#define STARPU_VECTOR_GET_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the array designated by `interface`, to be used with OpenCL. the offset returned by STARPU_VECTOR_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_VECTOR_GET_OFFSET

#define STARPU_VECTOR_GET_OFFSET | ( |  | interface | ) |

Return the offset in the array designated by `interface`, to be used with the device handle.

## ◆ STARPU_VECTOR_GET_NX

#define STARPU_VECTOR_GET_NX | ( |  | interface | ) |

Return the number of elements registered into the array designated by `interface`.

## ◆ STARPU_VECTOR_GET_ELEMSIZE

#define STARPU_VECTOR_GET_ELEMSIZE | ( |  | interface | ) |

Return the size of each element of the array designated by `interface`.

## ◆ STARPU_VECTOR_GET_ALLOCSIZE

#define STARPU_VECTOR_GET_ALLOCSIZE | ( |  | interface | ) |

Return the size of each element of the array designated by `interface`.

## ◆ STARPU_VECTOR_GET_SLICE_BASE

#define STARPU_VECTOR_GET_SLICE_BASE | ( |  | interface | ) |

Return the OpenMP slice base annotation of each element of the array designated by `interface`.

## ◆ STARPU_VECTOR_SET_NX

#define STARPU_VECTOR_SET_NX | ( |  | interface,
|  |  | newnx
| ) |  |

Set the number of elements registered into the array designated by `interface`.

## ◆ STARPU_VARIABLE_GET_PTR

#define STARPU_VARIABLE_GET_PTR | ( |  | interface | ) |

Return a pointer to the variable designated by `interface`.

## ◆ STARPU_VARIABLE_GET_OFFSET

#define STARPU_VARIABLE_GET_OFFSET | ( |  | interface | ) |

Return the offset in the variable designated by `interface`, to be used with the device handle.

## ◆ STARPU_VARIABLE_GET_ELEMSIZE

#define STARPU_VARIABLE_GET_ELEMSIZE | ( |  | interface | ) |

Return the size of the variable designated by `interface`.

## ◆ STARPU_VARIABLE_GET_DEV_HANDLE

#define STARPU_VARIABLE_GET_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the variable designated by `interface`, to be used with OpenCL. The offset returned by STARPU_VARIABLE_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_CSR_GET_NNZ

#define STARPU_CSR_GET_NNZ | ( |  | interface | ) |

Return the number of non-zero values in the matrix designated by `interface`.

## ◆ STARPU_CSR_GET_NROW

#define STARPU_CSR_GET_NROW | ( |  | interface | ) |

Return the size of the row pointer array of the matrix designated by `interface`.

## ◆ STARPU_CSR_GET_NZVAL

#define STARPU_CSR_GET_NZVAL | ( |  | interface | ) |

Return a pointer to the non-zero values of the matrix designated by `interface`.

## ◆ STARPU_CSR_GET_NZVAL_DEV_HANDLE

#define STARPU_CSR_GET_NZVAL_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the array of non-zero values in the matrix designated by `interface`. The offset returned by STARPU_CSR_GET_OFFSET has to used in addition to this.

## ◆ STARPU_CSR_GET_COLIND

#define STARPU_CSR_GET_COLIND | ( |  | interface | ) |

Return a pointer to the column index of the matrix designated by `interface`.

## ◆ STARPU_CSR_GET_COLIND_DEV_HANDLE

#define STARPU_CSR_GET_COLIND_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the column index of the matrix designated by `interface`. The offset returned by STARPU_CSR_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_CSR_GET_ROWPTR

#define STARPU_CSR_GET_ROWPTR | ( |  | interface | ) |

Return a pointer to the row pointer array of the matrix designated by `interface`.

## ◆ STARPU_CSR_GET_ROWPTR_DEV_HANDLE

#define STARPU_CSR_GET_ROWPTR_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the row pointer array of the matrix designated by `interface`. The offset returned by STARPU_CSR_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_CSR_GET_OFFSET

#define STARPU_CSR_GET_OFFSET

Return the offset in the arrays (colind, rowptr, nzval) of the matrix designated by `interface`, to be used with the device handles.

## ◆ STARPU_CSR_GET_FIRSTENTRY

#define STARPU_CSR_GET_FIRSTENTRY | ( |  | interface | ) |

Return the index at which all arrays (the column indexes, the row pointers...) of the `interface` start.

## ◆ STARPU_CSR_GET_ELEMSIZE

#define STARPU_CSR_GET_ELEMSIZE | ( |  | interface | ) |

Return the size of the elements registered into the matrix designated by `interface`.

## ◆ STARPU_BCSR_GET_NNZ

#define STARPU_BCSR_GET_NNZ | ( |  | interface | ) |

Return the number of non-zero values in the matrix designated by `interface`.

## ◆ STARPU_BCSR_GET_NROW

#define STARPU_BCSR_GET_NROW | ( |  | interface | ) |

Return the number of block rows in the matrix designated by `interface`.

## ◆ STARPU_BCSR_GET_NZVAL

#define STARPU_BCSR_GET_NZVAL | ( |  | interface | ) |

Return a pointer to the non-zero values of the matrix designated by `interface`.

## ◆ STARPU_BCSR_GET_NZVAL_DEV_HANDLE

#define STARPU_BCSR_GET_NZVAL_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the array of non-zero values in the matrix designated by `interface`. The offset returned by STARPU_BCSR_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_BCSR_GET_COLIND

#define STARPU_BCSR_GET_COLIND | ( |  | interface | ) |

Return a pointer to the column index of the matrix designated by `interface`.

## ◆ STARPU_BCSR_GET_COLIND_DEV_HANDLE

#define STARPU_BCSR_GET_COLIND_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the column index of the matrix designated by `interface`. The offset returned by STARPU_BCSR_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_BCSR_GET_ROWPTR

#define STARPU_BCSR_GET_ROWPTR | ( |  | interface | ) |

Return a pointer to the row pointer array of the matrix designated by `interface`.

## ◆ STARPU_BCSR_GET_ROWPTR_DEV_HANDLE

#define STARPU_BCSR_GET_ROWPTR_DEV_HANDLE | ( |  | interface | ) |

Return a device handle for the row pointer array of the matrix designated by `interface`. The offset returned by STARPU_BCSR_GET_OFFSET has to be used in addition to this.

## ◆ STARPU_BCSR_GET_FIRSTENTRY

#define STARPU_BCSR_GET_FIRSTENTRY | ( |  | interface | ) |

Return the base of the indexing (0 or 1 usually) in the matrix designated by `interface`.

## ◆ STARPU_BCSR_GET_R

#define STARPU_BCSR_GET_R | ( |  | interface | ) |

Return the height of blocks in the matrix designated by `interface`.

## ◆ STARPU_BCSR_GET_C

#define STARPU_BCSR_GET_C | ( |  | interface | ) |

Return the width of blocks in the matrix designated by `interface`.

## ◆ STARPU_BCSR_GET_ELEMSIZE

#define STARPU_BCSR_GET_ELEMSIZE | ( |  | interface | ) |

Return the size of elements in the matrix designated by `interface`.

## ◆ STARPU_BCSR_GET_OFFSET

#define STARPU_BCSR_GET_OFFSET

Return the offset in the arrays (coling, rowptr, nzval) of the matrix designated by `interface`, to be used with the device handles.

## ◆ STARPU_MULTIFORMAT_GET_CPU_PTR

#define STARPU_MULTIFORMAT_GET_CPU_PTR | ( |  | interface | ) |

Return the local pointer to the data with CPU format.

## ◆ STARPU_MULTIFORMAT_GET_CUDA_PTR

#define STARPU_MULTIFORMAT_GET_CUDA_PTR | ( |  | interface | ) |

Return the local pointer to the data with CUDA format.

## ◆ STARPU_MULTIFORMAT_GET_OPENCL_PTR

#define STARPU_MULTIFORMAT_GET_OPENCL_PTR | ( |  | interface | ) |

Return the local pointer to the data with OpenCL format.

## ◆ STARPU_MULTIFORMAT_GET_MIC_PTR

#define STARPU_MULTIFORMAT_GET_MIC_PTR | ( |  | interface | ) |

Return the local pointer to the data with MIC format.

## ◆ STARPU_MULTIFORMAT_GET_NX

#define STARPU_MULTIFORMAT_GET_NX | ( |  | interface | ) |

Return the number of elements in the data.

## Enumeration Type Documentation

## ◆ starpu_data_interface_id

enum starpu_data_interface_id

Identifier for all predefined StarPU data interfaces

Enumerator
STARPU_UNKNOWN_INTERFACE_ID | Unknown interface
STARPU_MATRIX_INTERFACE_ID | Identifier for the matrix data interface
STARPU_BLOCK_INTERFACE_ID | Identifier for the block data interface
STARPU_VECTOR_INTERFACE_ID | Identifier for the vector data interface
STARPU_CSR_INTERFACE_ID | Identifier for the CSR data interface
STARPU_BCSR_INTERFACE_ID | Identifier for the BCSR data interface
STARPU_VARIABLE_INTERFACE_ID | Identifier for the variable data interface
STARPU_VOID_INTERFACE_ID | Identifier for the void data interface
STARPU_MULTIFORMAT_INTERFACE_ID | Identifier for the multiformat data interface
STARPU_COO_INTERFACE_ID | Identifier for the COO data interface
STARPU_MAX_INTERFACE_ID | Maximum number of data interfaces

## Function Documentation

## ◆ starpu_data_register()

void starpu_data_register | ( | starpu_data_handle_t * | handleptr,
|  | int | home_node,
|  | void * | data_interface,
|  | struct starpu_data_interface_ops * | ops
| ) |  |

Register a piece of data into the handle located at the `handleptr` address. The `data_interface` buffer contains the initial description of the data in the `home_node`. The `ops` argument is a pointer to a structure describing the different methods used to manipulate this type of interface. See starpu_data_interface_ops for more details on this structure. If `home_node` is -1, StarPU will automatically allocate the memory when it is used for the first time in write-only mode. Once such data handle has been automatically allocated, it is possible to access it using any access mode. Note that StarPU supplies a set of predefined types of interface (e.g. vector or matrix) which can be registered by the means of helper functions (e.g. starpu_vector_data_register() or starpu_matrix_data_register()).

## ◆ starpu_data_ptr_register()

void starpu_data_ptr_register | ( | starpu_data_handle_t | handle,
|  | unsigned | node
| ) |  |

Register that a buffer for `handle` on `node` will be set. This is typically used by starpu_*_ptr_register helpers before setting the interface pointers for this node, to tell the core that that is now allocated.

## ◆ starpu_data_register_same()

void starpu_data_register_same | ( | starpu_data_handle_t * | handledst,
|  | starpu_data_handle_t | handlesrc
| ) |  |

Register a new piece of data into the handle `handledst` with the same interface as the handle `handlesrc`.

## ◆ starpu_data_handle_to_pointer()

void * starpu_data_handle_to_pointer | ( | starpu_data_handle_t | handle,
|  | unsigned | node
| ) |  |

Return the pointer associated with `handle` on node `node` or `NULL` if handle’s interface does not support this operation or data for this `handle` is not allocated on that `node`.

## ◆ starpu_data_pointer_is_inside()

int starpu_data_pointer_is_inside | ( | starpu_data_handle_t | handle,
|  | unsigned | node,
|  | void * | ptr
| ) |  |

Return whether the given `ptr` is within the data for `handle` on node `node` (1) or not (0). If the handle interface does not support this operation, and thus the result is unknown, -1 is returned.

## ◆ starpu_data_get_local_ptr()

void * starpu_data_get_local_ptr | ( | starpu_data_handle_t | handle | ) |

Return the local pointer associated with `handle` or `NULL` if `handle’s` interface does not have any data allocated locally.

## ◆ starpu_data_get_interface_on_node()

void * starpu_data_get_interface_on_node | ( | starpu_data_handle_t | handle,
|  | unsigned | memory_node
| ) |  |

Return the interface associated with `handle` on `memory_node`.

## ◆ starpu_data_get_interface_id()

enum starpu_data_interface_id starpu_data_get_interface_id | ( | starpu_data_handle_t | handle | ) |

Return the unique identifier of the interface associated with the given `handle`.

## ◆ starpu_data_pack()

int starpu_data_pack | ( | starpu_data_handle_t | handle,
|  | void ** | ptr,
|  | starpu_ssize_t * | count
| ) |  |

Execute the packing operation of the interface of the data registered at `handle` (see starpu_data_interface_ops). This packing operation must allocate a buffer large enough at `ptr` and copy into the newly allocated buffer the data associated to `handle`. `count` will be set to the size of the allocated buffer. If `ptr` is `NULL`, the function should not copy the data in the buffer but just set `count` to the size of the buffer which would have been allocated. The special value -1 indicates the size is yet unknown.

## ◆ starpu_data_unpack()

int starpu_data_unpack | ( | starpu_data_handle_t | handle,
|  | void * | ptr,
|  | size_t | count
| ) |  |

Unpack in handle the data located at `ptr` of size `count` as described by the interface of the data. The interface registered at `handle` must define a unpacking operation (see starpu_data_interface_ops).

## ◆ starpu_data_get_size()

size_t starpu_data_get_size | ( | starpu_data_handle_t | handle | ) |

Return the size of the data associated with `handle`.

## ◆ starpu_data_get_alloc_size()

size_t starpu_data_get_alloc_size | ( | starpu_data_handle_t | handle | ) |

Return the size of the allocated data associated with `handle`.

## ◆ starpu_data_lookup()

starpu_data_handle_t starpu_data_lookup | ( | const void * | ptr | ) |

Return the handle corresponding to the data pointed to by the `ptr` host pointer.

## ◆ starpu_data_interface_get_next_id()

int starpu_data_interface_get_next_id | ( | void |  | ) |

Return the next available id for a newly created data interface (Defining A New Data Interface).

## ◆ 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
| ) |  |

Copy `size` bytes from byte offset `src_offset` of `src` on `src_node` to byte offset `dst_offset` of `dst` on `dst_node`. This is to be used in the starpu_data_copy_methods::any_to_any copy method, which is provided with `async_data` to be passed to starpu_interface_copy(). this returns `-EAGAIN` if the transfer is still ongoing, or 0 if the transfer is already completed.

## ◆ 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
| ) |  |

Copy `numblocks` blocks of `blocksize` bytes from byte offset `src_offset` of `src` on `src_node` to byte offset `dst_offset` of `dst` on `dst_node`.

The blocks start at addresses which are ld_src (resp. ld_dst) bytes apart in the source (resp. destination) interface.

If blocksize == ld_src == ld_dst, the transfer is optimized into a single starpu_interface_copy call.

This is to be used in the starpu_data_copy_methods::any_to_any copy method for 2D data, which is provided with `async_data` to be passed to starpu_interface_copy(). this returns `-EAGAIN` if the transfer is still ongoing, or 0 if the transfer is already completed.

## ◆ 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
| ) |  |

Copy `numblocks_1` * `numblocks_2` blocks of `blocksize` bytes from byte offset `src_offset` of `src` on `src_node` to byte offset `dst_offset` of `dst` on `dst_node`.

The blocks are grouped by `numblocks_1` blocks whose start addresses are ld1_src (resp. ld1_dst) bytes apart in the source (resp. destination) interface.

Such groups are grouped by numblocks_2 groups whose start addresses are ld2_src (resp. ld2_dst) bytes apart in the source (resp. destination) interface.

If the blocks are contiguous, the transfers will be optimized.

This is to be used in the starpu_data_copy_methods::any_to_any copy method for 3D data, which is provided with `async_data` to be passed to starpu_interface_copy(). this returns `-EAGAIN` if the transfer is still ongoing, or 0 if the transfer is already completed.

## ◆ 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
| ) |  |

Copy `numblocks_1` * `numblocks_2` * `numblocks_3` blocks of `blocksize` bytes from byte offset `src_offset` of `src` on `src_node` to byte offset `dst_offset` of `dst` on `dst_node`.

The blocks are grouped by `numblocks_1` blocks whose start addresses are ld1_src (resp. ld1_dst) bytes apart in the source (resp. destination) interface.

Such groups are grouped by numblocks_2 groups whose start addresses are ld2_src (resp. ld2_dst) bytes apart in the source (resp. destination) interface.

Such groups are grouped by numblocks_3 groups whose start addresses are ld3_src (resp. ld3_dst) bytes apart in the source (resp. destination) interface.

If the blocks are contiguous, the transfers will be optimized.

This is to be used in the starpu_data_copy_methods::any_to_any copy method for 3D data, which is provided with `async_data` to be passed to starpu_interface_copy(). this returns `-EAGAIN` if the transfer is still ongoing, or 0 if the transfer is already completed.

## ◆ starpu_interface_start_driver_copy_async()

void starpu_interface_start_driver_copy_async | ( | unsigned | src_node,
|  | unsigned | dst_node,
|  | double * | start
| ) |  |

When an asynchonous implementation of the data transfer is implemented, the call to the underlying CUDA, OpenCL, etc. call should be surrounded by calls to starpu_interface_start_driver_copy_async() and starpu_interface_end_driver_copy_async(), so that it is recorded in offline execution traces, and the timing of the submission is checked. `start` must point to a variable whose value will be passed unchanged to starpu_interface_end_driver_copy_async().

## ◆ starpu_interface_end_driver_copy_async()

void starpu_interface_end_driver_copy_async | ( | unsigned | src_node,
|  | unsigned | dst_node,
|  | double | start
| ) |  |

See starpu_interface_start_driver_copy_async().

## ◆ starpu_interface_data_copy()

void starpu_interface_data_copy | ( | unsigned | src_node,
|  | unsigned | dst_node,
|  | size_t | size
| ) |  |

Record in offline execution traces the copy of `size` bytes from node `src_node` to node `dst_node`

## ◆ starpu_malloc_on_node_flags()

uintptr_t starpu_malloc_on_node_flags | ( | unsigned | dst_node,
|  | size_t | size,
|  | int | flags
| ) |  |

Allocate `size` bytes on node `dst_node` with the given allocation `flags`. This returns 0 if allocation failed, the allocation method should then return `-ENOMEM` as allocated size. Deallocation must be done with starpu_free_on_node_flags().

## ◆ starpu_malloc_on_node()

uintptr_t starpu_malloc_on_node | ( | unsigned | dst_node,
|  | size_t | size
| ) |  |

Allocate `size` bytes on node `dst_node` with the default allocation flags. This returns 0 if allocation failed, the allocation method should then return `-ENOMEM` as allocated size. Deallocation must be done with starpu_free_on_node().

## ◆ starpu_free_on_node_flags()

void starpu_free_on_node_flags | ( | unsigned | dst_node,
|  | uintptr_t | addr,
|  | size_t | size,
|  | int | flags
| ) |  |

Free `addr` of `size` bytes on node `dst_node` which was previously allocated with starpu_malloc_on_node_flags() with the given allocation `flags`.

## ◆ starpu_free_on_node()

void starpu_free_on_node | ( | unsigned | dst_node,
|  | uintptr_t | addr,
|  | size_t | size
| ) |  |

Free `addr` of `size` bytes on node `dst_node` which was previously allocated with starpu_malloc_on_node().

## ◆ starpu_malloc_on_node_set_default_flags()

void starpu_malloc_on_node_set_default_flags | ( | unsigned | node,
|  | int | flags
| ) |  |

Define the default flags for allocations performed by starpu_malloc_on_node() and starpu_free_on_node(). The default is STARPU_MALLOC_PINNED | STARPU_MALLOC_COUNT.

## ◆ 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
| ) |  |

Register the `nx` x `ny` 2D matrix of `elemsize-byte` elements pointed by `ptr` and initialize `handle` to represent it. `ld` specifies the number of elements between rows. a value greater than `nx` adds padding, which can be useful for alignment purposes.

Here an example of how to use the function.

float *matrix;
starpu_data_handle_t matrix_handle;
matrix = (float*)malloc(width * height * sizeof(float));
starpu_matrix_data_register(&matrix_handle, STARPU_MAIN_RAM, (uintptr_t)matrix, width, width, height, sizeof(float));
STARPU_MAIN_RAM
#define STARPU_MAIN_RAM
Definition: starpu_task.h:119
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_data_handle_t
struct _starpu_data_state * starpu_data_handle_t
Definition: starpu_data.h:44

## ◆ 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
| ) |  |

Similar to starpu_matrix_data_register, but additionally specifies which allocation size should be used instead of the initial nx*ny*elemsize.

## ◆ 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
| ) |  |

Register into the `handle` that to store data on node `node` it should use the buffer located at `ptr`, or device handle `dev_handle` and offset `offset` (for OpenCL, notably), with `ld` elements between rows.

## ◆ starpu_matrix_get_nx()

uint32_t starpu_matrix_get_nx | ( | starpu_data_handle_t | handle | ) |

Return the number of elements on the x-axis of the matrix designated by `handle`.

## ◆ starpu_matrix_get_ny()

uint32_t starpu_matrix_get_ny | ( | starpu_data_handle_t | handle | ) |

Return the number of elements on the y-axis of the matrix designated by `handle`.

## ◆ starpu_matrix_get_local_ld()

uint32_t starpu_matrix_get_local_ld | ( | starpu_data_handle_t | handle | ) |

Return the number of elements between each row of the matrix designated by `handle`. Maybe be equal to nx when there is no padding.

## ◆ starpu_matrix_get_local_ptr()

uintptr_t starpu_matrix_get_local_ptr | ( | starpu_data_handle_t | handle | ) |

Return the local pointer associated with `handle`.

## ◆ starpu_matrix_get_elemsize()

size_t starpu_matrix_get_elemsize | ( | starpu_data_handle_t | handle | ) |

Return the size of the elements registered into the matrix designated by `handle`.

## ◆ starpu_matrix_get_allocsize()

size_t starpu_matrix_get_allocsize | ( | starpu_data_handle_t | handle | ) |

Return the allocated size of the matrix designated by `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
| ) |  |

Register the `nx` x `ny` 2D matrix given in the COO format, using the `columns`, `rows`, `values` arrays, which must have `n_values` elements of size `elemsize`. Initialize `handleptr`.

## ◆ 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
| ) |  |

Register the `nx` x `ny` x `nz` 3D matrix of `elemsize` byte elements pointed by `ptr` and initialize `handle` to represent it. Again, `ldy` and `ldz` specify the number of elements between rows and between z planes.

Here an example of how to use the function.

float *block;
starpu_data_handle_t block_handle;
block = (float*)malloc(nx*ny*nz*sizeof(float));
starpu_block_data_register(&block_handle, STARPU_MAIN_RAM, (uintptr_t)block, nx, nx*ny, nx, ny, nz, sizeof(float));
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_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
| ) |  |

Register into the `handle` that to store data on node `node` it should use the buffer located at `ptr`, or device handle `dev_handle` and offset `offset` (for OpenCL, notably), with `ldy` elements between rows and `ldz` elements between z planes.

## ◆ starpu_block_get_nx()

uint32_t starpu_block_get_nx | ( | starpu_data_handle_t | handle | ) |

Return the number of elements on the x-axis of the block designated by `handle`.

## ◆ starpu_block_get_ny()

uint32_t starpu_block_get_ny | ( | starpu_data_handle_t | handle | ) |

Return the number of elements on the y-axis of the block designated by `handle`.

## ◆ starpu_block_get_nz()

uint32_t starpu_block_get_nz | ( | starpu_data_handle_t | handle | ) |

Return the number of elements on the z-axis of the block designated by `handle`.

## ◆ starpu_block_get_local_ldy()

uint32_t starpu_block_get_local_ldy | ( | starpu_data_handle_t | handle | ) |

Return the number of elements between each row of the block designated by `handle`, in the format of the current memory node.

## ◆ starpu_block_get_local_ldz()

uint32_t starpu_block_get_local_ldz | ( | starpu_data_handle_t | handle | ) |

Return the number of elements between each z plane of the block designated by `handle`, in the format of the current memory node.

## ◆ starpu_block_get_local_ptr()

uintptr_t starpu_block_get_local_ptr | ( | starpu_data_handle_t | handle | ) |

Return the local pointer associated with `handle`.

## ◆ starpu_block_get_elemsize()

size_t starpu_block_get_elemsize | ( | starpu_data_handle_t | handle | ) |

Return the size of the elements of the block designated by `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
| ) |  |

Register the `nx` `elemsize-byte` elements pointed to by `ptr` and initialize `handle` to represent it.

Here an example of how to use the function.

float vector[NX];
starpu_data_handle_t vector_handle;
starpu_vector_data_register(&vector_handle, STARPU_MAIN_RAM, (uintptr_t)vector, NX, sizeof(vector[0]));
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_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
| ) |  |

Similar to starpu_matrix_data_register, but additionally specifies which allocation size should be used instead of the initial nx*elemsize.

## ◆ 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
| ) |  |

Register into the `handle` that to store data on node `node` it should use the buffer located at `ptr`, or device handle `dev_handle` and offset `offset` (for OpenCL, notably)

## ◆ starpu_vector_get_nx()

uint32_t starpu_vector_get_nx | ( | starpu_data_handle_t | handle | ) |

Return the number of elements registered into the array designated by `handle`.

## ◆ starpu_vector_get_elemsize()

size_t starpu_vector_get_elemsize | ( | starpu_data_handle_t | handle | ) |

Return the size of each element of the array designated by `handle`.

## ◆ starpu_vector_get_allocsize()

size_t starpu_vector_get_allocsize | ( | starpu_data_handle_t | handle | ) |

Return the allocated size of the array designated by `handle`.

## ◆ starpu_vector_get_local_ptr()

uintptr_t starpu_vector_get_local_ptr | ( | starpu_data_handle_t | handle | ) |

Return the local pointer associated with `handle`.

## ◆ starpu_variable_data_register()

void starpu_variable_data_register | ( | starpu_data_handle_t * | handle,
|  | int | home_node,
|  | uintptr_t | ptr,
|  | size_t | size
| ) |  |

Register the `size` byte element pointed to by `ptr`, which is typically a scalar, and initialize `handle` to represent this data item.

Here an example of how to use the function.

float var = 42.0;
starpu_data_handle_t var_handle;
starpu_variable_data_register(&var_handle, STARPU_MAIN_RAM, (uintptr_t)&var, sizeof(var));
starpu_variable_data_register
void starpu_variable_data_register(starpu_data_handle_t *handle, int home_node, uintptr_t ptr, size_t size)

## ◆ 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
| ) |  |

Register into the `handle` that to store data on node `node` it should use the buffer located at `ptr`, or device handle `dev_handle` and offset `offset` (for OpenCL, notably)

## ◆ starpu_variable_get_elemsize()

size_t starpu_variable_get_elemsize | ( | starpu_data_handle_t | handle | ) |

Return the size of the variable designated by `handle`.

## ◆ starpu_variable_get_local_ptr()

uintptr_t starpu_variable_get_local_ptr | ( | starpu_data_handle_t | handle | ) |

Return a pointer to the variable designated by `handle`.

## ◆ starpu_void_data_register()

void starpu_void_data_register | ( | starpu_data_handle_t * | handle | ) |

Register a void interface. There is no data really associated to that interface, but it may be used as a synchronization mechanism. It also permits to express an abstract piece of data that is managed by the application internally: this makes it possible to forbid the concurrent execution of different tasks accessing the same `void` data in read-write concurrently.

## ◆ 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
| ) |  |

Register a CSR (Compressed Sparse Row Representation) sparse matrix.

## ◆ starpu_csr_get_nnz()

uint32_t starpu_csr_get_nnz | ( | starpu_data_handle_t | handle | ) |

Return the number of non-zero values in the matrix designated by `handle`.

## ◆ starpu_csr_get_nrow()

uint32_t starpu_csr_get_nrow | ( | starpu_data_handle_t | handle | ) |

Return the size of the row pointer array of the matrix designated by `handle`.

## ◆ starpu_csr_get_firstentry()

uint32_t starpu_csr_get_firstentry | ( | starpu_data_handle_t | handle | ) |

Return the index at which all arrays (the column indexes, the row pointers...) of the matrix designated by `handle`.

## ◆ starpu_csr_get_local_nzval()

uintptr_t starpu_csr_get_local_nzval | ( | starpu_data_handle_t | handle | ) |

Return a local pointer to the non-zero values of the matrix designated by `handle`.

## ◆ starpu_csr_get_local_colind()

uint32_t * starpu_csr_get_local_colind | ( | starpu_data_handle_t | handle | ) |

Return a local pointer to the column index of the matrix designated by `handle`.

## ◆ starpu_csr_get_local_rowptr()

uint32_t * starpu_csr_get_local_rowptr | ( | starpu_data_handle_t | handle | ) |

Return a local pointer to the row pointer array of the matrix designated by `handle`.

## ◆ starpu_csr_get_elemsize()

size_t starpu_csr_get_elemsize | ( | starpu_data_handle_t | handle | ) |

Return the size of the elements registered into the matrix designated by `handle`.

## ◆ 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
| ) |  |

This variant of starpu_data_register() uses the BCSR (Blocked Compressed Sparse Row Representation) sparse matrix interface. Register the sparse matrix made of `nnz` non-zero blocks of elements of size `elemsize` stored in `nzval` and initializes `handle` to represent it. Blocks have size `r` * `c`. `nrow` is the number of rows (in terms of blocks), `colind` is an array of nnz elements, colind[i] is the block-column index for block i in `nzval`, `rowptr` is an array of nrow+1 elements, rowptr[i] is the block-index (in `nzval`) of the first block of row i. By convention, rowptr[nrow] is the number of blocks, this allows an easier access of the matrix's elements for the kernels. `firstentry` is the index of the first entry of the given arrays (usually 0 or 1).

Here an example with the following matrix:

| 0 1 0 0 |
| 2 3 0 0 |
| 4 5 8 9 |
| 6 7 10 11 |
nzval = [0, 1, 2, 3] ++ [4, 5, 6, 7] ++ [8, 9, 10, 11]
colind = [0, 0, 1]
rowptr = [0, 1, 3]
r = c = 2

which translates into the following code

int R = 2; // Size of the blocks
int C = 2;
int NROWS = 2;
int NNZ_BLOCKS = 3; // out of 4
int NZVAL_SIZE = (R*C*NNZ_BLOCKS);
int nzval[NZVAL_SIZE] =
{
0, 1, 2, 3, // First block
4, 5, 6, 7, // Second block
8, 9, 10, 11 // Third block
};
uint32_t colind[NNZ_BLOCKS] =
{
0, // block-column index for first block in nzval
0, // block-column index for second block in nzval
1 // block-column index for third block in nzval
};
uint32_t rowptr[NROWS+1] =
{
0, // block-index in nzval of the first block of the first row.
1, // block-index in nzval of the first block of the second row.
NNZ_BLOCKS // number of blocks, to allow an easier element's access for the kernels
};
starpu_data_handle_t bcsr_handle;
starpu_bcsr_data_register(&bcsr_handle,
STARPU_MAIN_RAM,
NNZ_BLOCKS,
NROWS,
(uintptr_t) nzval,
colind,
rowptr,
0, // firstentry
R,
C,
sizeof(nzval[0]));
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_bcsr_get_nnz()

uint32_t starpu_bcsr_get_nnz | ( | starpu_data_handle_t | handle | ) |

Return the number of non-zero elements in the matrix designated by `handle`.

## ◆ starpu_bcsr_get_nrow()

uint32_t starpu_bcsr_get_nrow | ( | starpu_data_handle_t | handle | ) |

Return the number of rows (in terms of blocks of size r*c) in the matrix designated by `handle`.

## ◆ starpu_bcsr_get_firstentry()

uint32_t starpu_bcsr_get_firstentry | ( | starpu_data_handle_t | handle | ) |

Return the index at which all arrays (the column indexes, the row pointers...) of the matrix desginated by `handle`.

## ◆ starpu_bcsr_get_local_nzval()

uintptr_t starpu_bcsr_get_local_nzval | ( | starpu_data_handle_t | handle | ) |

Return a pointer to the non-zero values of the matrix designated by `handle`.

## ◆ starpu_bcsr_get_local_colind()

uint32_t * starpu_bcsr_get_local_colind | ( | starpu_data_handle_t | handle | ) |

Return a pointer to the column index, which holds the positions of the non-zero entries in the matrix designated by `handle`.

## ◆ starpu_bcsr_get_local_rowptr()

uint32_t * starpu_bcsr_get_local_rowptr | ( | starpu_data_handle_t | handle | ) |

Return the row pointer array of the matrix designated by `handle`.

## ◆ starpu_bcsr_get_r()

uint32_t starpu_bcsr_get_r | ( | starpu_data_handle_t | handle | ) |

Return the number of rows in a block.

## ◆ starpu_bcsr_get_c()

uint32_t starpu_bcsr_get_c | ( | starpu_data_handle_t | handle | ) |

Return the number of columns in a block.

## ◆ starpu_bcsr_get_elemsize()

size_t starpu_bcsr_get_elemsize | ( | starpu_data_handle_t | handle | ) |

Return the size of the elements in the matrix designated by `handle`.

## ◆ 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
| ) |  |

Register a piece of data that can be represented in different ways, depending upon the processing unit that manipulates it. It allows the programmer, for instance, to use an array of structures when working on a CPU, and a structure of arrays when working on a GPU. `nobjects` is the number of elements in the data. `format_ops` describes the format.

## ◆ starpu_hash_crc32c_be_n()

uint32_t starpu_hash_crc32c_be_n | ( | const void * | input,
|  | size_t | n,
|  | uint32_t | inputcrc
| ) |  |

Compute the CRC of a byte buffer seeded by the `inputcrc` current state. The return value should be considered as the new current state for future CRC computation. This is used for computing data size footprint.

## ◆ starpu_hash_crc32c_be()

uint32_t starpu_hash_crc32c_be | ( | uint32_t | input,
|  | uint32_t | inputcrc
| ) |  |

Compute the CRC of a 32bit number seeded by the `inputcrc` current state. The return value should be considered as the new current state for future CRC computation. This is used for computing data size footprint.

## ◆ starpu_hash_crc32c_string()

uint32_t starpu_hash_crc32c_string | ( | const char * | str,
|  | uint32_t | inputcrc
| ) |  |

Compute the CRC of a string seeded by the `inputcrc` current state. The return value should be considered as the new current state for future CRC computation. This is used for computing data size footprint.