StarPU Handbook
|
Data Structures | |
struct | starpu_data_interface_ops |
struct | starpu_data_copy_methods |
struct | starpu_variable_interface |
struct | starpu_vector_interface |
struct | starpu_matrix_interface |
struct | starpu_block_interface |
struct | starpu_bcsr_interface |
struct | starpu_csr_interface |
struct | starpu_coo_interface |
Registering Data | |
There are several ways to register a memory region so that it can be managed by StarPU. The functions below allow the registration of vectors, 2D matrices, 3D matrices as well as BCSR and CSR sparse matrices. | |
void | starpu_void_data_register (starpu_data_handle_t *handle) |
void | starpu_variable_data_register (starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, size_t size) |
void | starpu_vector_data_register (starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t nx, size_t elemsize) |
void | starpu_matrix_data_register (starpu_data_handle_t *handle, unsigned home_node, uintptr_t ptr, uint32_t ld, uint32_t nx, uint32_t ny, size_t elemsize) |
void | starpu_block_data_register (starpu_data_handle_t *handle, unsigned 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_bcsr_data_register (starpu_data_handle_t *handle, unsigned 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) |
void | starpu_csr_data_register (starpu_data_handle_t *handle, unsigned home_node, uint32_t nnz, uint32_t nrow, uintptr_t nzval, uint32_t *colind, uint32_t *rowptr, uint32_t firstentry, size_t elemsize) |
void | starpu_coo_data_register (starpu_data_handle_t *handleptr, unsigned home_node, uint32_t nx, uint32_t ny, uint32_t n_values, uint32_t *columns, uint32_t *rows, uintptr_t values, size_t elemsize) |
void * | starpu_data_get_interface_on_node (starpu_data_handle_t handle, unsigned memory_node) |
Accessing Data Interfaces | |
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 Using StarPU's API). | |
void * | starpu_data_handle_to_pointer (starpu_data_handle_t handle, unsigned node) |
void * | starpu_data_get_local_ptr (starpu_data_handle_t handle) |
enum starpu_data_interface_id | starpu_data_get_interface_id (starpu_data_handle_t handle) |
size_t | starpu_data_get_size (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) |
Accessing Variable Data Interfaces | |
#define | STARPU_VARIABLE_GET_PTR(interface) |
#define | STARPU_VARIABLE_GET_ELEMSIZE(interface) |
#define | STARPU_VARIABLE_GET_DEV_HANDLE(interface) |
#define | STARPU_VARIABLE_GET_OFFSET |
size_t | starpu_variable_get_elemsize (starpu_data_handle_t handle) |
uintptr_t | starpu_variable_get_local_ptr (starpu_data_handle_t handle) |
Accessing Vector Data Interfaces | |
#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) |
uint32_t | starpu_vector_get_nx (starpu_data_handle_t handle) |
size_t | starpu_vector_get_elemsize (starpu_data_handle_t handle) |
uintptr_t | starpu_vector_get_local_ptr (starpu_data_handle_t handle) |
Accessing Matrix Data Interfaces | |
#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) |
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) |
Accessing Block Data Interfaces | |
#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) |
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) |
Accessing BCSR Data Interfaces | |
#define | STARPU_BCSR_GET_NNZ(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_OFFSET |
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) |
Accessing CSR Data Interfaces | |
#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) |
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) |
Accessing COO Data Interfaces | |
#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) |
Defining Interface | |
Applications can provide their own interface as shown in Defining A New Data Interface. | |
uintptr_t | starpu_malloc_on_node (unsigned dst_node, size_t size) |
void | starpu_free_on_node (unsigned dst_node, uintptr_t addr, size_t size) |
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) |
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) |
int | starpu_data_interface_get_next_id (void) |
struct starpu_data_interface_ops |
Per-interface data transfer methods.
Data Fields | |
void(* | register_data_handle )(starpu_data_handle_t handle, unsigned home_node, void *data_interface) |
starpu_ssize_t(* | allocate_data_on_node )(void *data_interface, unsigned node) |
void(* | free_data_on_node )(void *data_interface, unsigned node) |
struct starpu_data_copy_methods * | copy_methods |
void *(* | handle_to_pointer )(starpu_data_handle_t handle, unsigned node) |
size_t(* | get_size )(starpu_data_handle_t handle) |
uint32_t(* | footprint )(starpu_data_handle_t handle) |
int(* | compare )(void *data_interface_a, void *data_interface_b) |
void(* | display )(starpu_data_handle_t handle, FILE *f) |
enum starpu_data_interface_id | interfaceid |
size_t | interface_size |
int | is_multiformat |
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) |
starpu_data_interface_ops::register_data_handle |
Register an existing interface into a data handle.
starpu_data_interface_ops::allocate_data_on_node |
Allocate data for the interface on a given node.
starpu_data_interface_ops::free_data_on_node |
Free data of the interface on a given node.
starpu_data_interface_ops::copy_methods |
ram/cuda/opencl synchronous and asynchronous transfer methods.
starpu_data_interface_ops::handle_to_pointer |
Return the current pointer (if any) for the handle on the given node.
starpu_data_interface_ops::get_size |
Return an estimation of the size of data, for performance models.
starpu_data_interface_ops::footprint |
Return a 32bit footprint which characterizes the data size.
starpu_data_interface_ops::compare |
Compare the data size of two interfaces.
starpu_data_interface_ops::display |
Dump the sizes of a handle to a file.
starpu_data_interface_ops::interfaceid |
An identifier that is unique to each interface.
starpu_data_interface_ops::interface_size |
The size of the interface data descriptor.
starpu_data_interface_ops::is_multiformat |
todo
|
read |
todo
starpu_data_interface_ops::pack_data |
Pack the data handle into a contiguous buffer at the address 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.
starpu_data_interface_ops::unpack_data |
Unpack the data handle from the contiguous buffer at the address ptr of size count
struct starpu_data_copy_methods |
Defines the per-interface methods. If the any_to_any method is provided, it will be used by default if no more 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(* | 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(* | 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(* | ram_to_cuda_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cudaStream_t stream) |
int(* | cuda_to_ram_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, cudaStream_t stream) |
int(* | cuda_to_cuda_async )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, 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(* | any_to_any )(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *async_data) |
starpu_data_copy_methods::ram_to_ram |
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.
starpu_data_copy_methods::ram_to_cuda |
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.
starpu_data_copy_methods::ram_to_opencl |
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.
starpu_data_copy_methods::cuda_to_ram |
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.
starpu_data_copy_methods::cuda_to_cuda |
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.
starpu_data_copy_methods::cuda_to_opencl |
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.
starpu_data_copy_methods::opencl_to_ram |
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.
starpu_data_copy_methods::opencl_to_cuda |
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.
starpu_data_copy_methods::opencl_to_opencl |
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.
starpu_data_copy_methods::ram_to_cuda_async |
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.
starpu_data_copy_methods::cuda_to_ram_async |
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.
starpu_data_copy_methods::cuda_to_cuda_async |
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.
starpu_data_copy_methods::ram_to_opencl_async |
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.
starpu_data_copy_methods::opencl_to_ram_async |
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.
starpu_data_copy_methods::opencl_to_opencl_async |
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.
starpu_data_copy_methods::any_to_any |
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.
struct starpu_variable_interface |
struct starpu_vector_interface |
Vector interface
vector interface for contiguous (non-strided) buffers
struct starpu_matrix_interface |
Matrix interface for dense matrices
Data Fields | ||
---|---|---|
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 |
struct starpu_block_interface |
Block interface for 3D dense blocks
struct starpu_bcsr_interface |
BCSR interface for sparse matrices (blocked compressed sparse row representation)
struct starpu_csr_interface |
CSR interface for sparse matrices (compressed sparse row representation)
struct starpu_coo_interface |
COO Matrices
#define STARPU_VARIABLE_GET_PTR | ( | interface | ) |
Return a pointer to the variable designated by interface
.
#define STARPU_VARIABLE_GET_ELEMSIZE | ( | interface | ) |
Return the size of the variable designated by interface
.
#define STARPU_VARIABLE_GET_DEV_HANDLE | ( | interface | ) |
Return a device handle for the variable designated by interface
, to be used on OpenCL. The offset documented below has to be used in addition to this.
#define STARPU_VARIABLE_GET_OFFSET |
Return the offset in the variable designated by interface
, to be used with the device handle.
#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.
#define STARPU_VECTOR_GET_DEV_HANDLE | ( | interface | ) |
Return a device handle for the array designated by interface
, to be used on OpenCL. the offset documented below has to be used in addition to this.
#define STARPU_VECTOR_GET_OFFSET | ( | interface | ) |
Return the offset in the array designated by interface
, to be used with the device handle.
#define STARPU_VECTOR_GET_NX | ( | interface | ) |
Return the number of elements registered into the array designated by interface
.
#define STARPU_VECTOR_GET_ELEMSIZE | ( | interface | ) |
Return the size of each element of the array designated by interface
.
#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.
#define STARPU_MATRIX_GET_DEV_HANDLE | ( | interface | ) |
Return a device handle for the matrix designated by interface
, to be used on OpenCL. The offset documented below has to be used in addition to this.
#define STARPU_MATRIX_GET_OFFSET | ( | interface | ) |
Return the offset in the matrix designated by interface
, to be used with the device handle.
#define STARPU_MATRIX_GET_NX | ( | interface | ) |
Return the number of elements on the x-axis of the matrix designated by interface
.
#define STARPU_MATRIX_GET_NY | ( | interface | ) |
Return the number of elements on the y-axis of the matrix designated by interface
.
#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.
#define STARPU_MATRIX_GET_ELEMSIZE | ( | interface | ) |
Return the size of the elements registered into the matrix designated by interface
.
#define STARPU_BLOCK_GET_PTR | ( | interface | ) |
Return a pointer to the block designated by interface
.
#define STARPU_BLOCK_GET_DEV_HANDLE | ( | interface | ) |
Return a device handle for the block designated by interface
, to be used on OpenCL. The offset document below has to be used in addition to this.
#define STARPU_BLOCK_GET_OFFSET | ( | interface | ) |
Return the offset in the block designated by interface
, to be used with the device handle.
#define STARPU_BLOCK_GET_NX | ( | interface | ) |
Return the number of elements on the x-axis of the block designated by interface
.
#define STARPU_BLOCK_GET_NY | ( | interface | ) |
Return the number of elements on the y-axis of the block designated by interface
.
#define STARPU_BLOCK_GET_NZ | ( | interface | ) |
Return the number of elements on the z-axis of the block designated by interface
.
#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.
#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.
#define STARPU_BLOCK_GET_ELEMSIZE | ( | interface | ) |
Return the size of the elements of the block designated by interface
.
#define STARPU_BCSR_GET_NNZ | ( | interface | ) |
Return the number of non-zero values in the matrix designated by interface
.
#define STARPU_BCSR_GET_NZVAL | ( | interface | ) |
Return a pointer to the non-zero values of the matrix designated by interface
.
#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 documented below has to be used in addition to this.
#define STARPU_BCSR_GET_COLIND | ( | interface | ) |
Return a pointer to the column index of the matrix designated by interface
.
#define STARPU_BCSR_GET_COLIND_DEV_HANDLE | ( | interface | ) |
Return a device handle for the column index of the matrix designated by interface
. The offset documented below has to be used in addition to this.
#define STARPU_BCSR_GET_ROWPTR | ( | interface | ) |
Return a pointer to the row pointer array of the matrix designated by interface
.
#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 documented below has to be used in addition to this.
#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.
#define STARPU_CSR_GET_NNZ | ( | interface | ) |
Return the number of non-zero values in the matrix designated by interface
.
#define STARPU_CSR_GET_NROW | ( | interface | ) |
Return the size of the row pointer array of the matrix designated by interface
.
#define STARPU_CSR_GET_NZVAL | ( | interface | ) |
Return a pointer to the non-zero values of the matrix designated by interface
.
#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 documented below has to be used in addition to this.
#define STARPU_CSR_GET_COLIND | ( | interface | ) |
Return a pointer to the column index of the matrix designated by interface
.
#define STARPU_CSR_GET_COLIND_DEV_HANDLE | ( | interface | ) |
Return a device handle for the column index of the matrix designated by interface
. The offset documented below has to be used in addition to this.
#define STARPU_CSR_GET_ROWPTR | ( | interface | ) |
Return a pointer to the row pointer array of the matrix designated by interface
.
#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 documented below has to be used in addition to this.
#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.
#define STARPU_CSR_GET_FIRSTENTRY | ( | interface | ) |
Return the index at which all arrays (the column indexes, the row pointers...) of the interface
start.
#define STARPU_CSR_GET_ELEMSIZE | ( | interface | ) |
Return the size of the elements registered into the matrix designated by interface
.
#define STARPU_COO_GET_COLUMNS | ( | interface | ) |
Return a pointer to the column array of the matrix designated by interface
.
#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 on OpenCL. The offset documented below has to be used in addition to this.
#define STARPU_COO_GET_ROWS | ( | interface | ) |
Return a pointer to the rows array of the matrix designated by interface
.
#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 documented below has to be used in addition to this.
#define STARPU_COO_GET_VALUES | ( | interface | ) |
Return a pointer to the values array of the matrix designated by interface
.
#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 documented below has to be used in addition to this.
#define STARPU_COO_GET_OFFSET |
Return the offset in the arrays of the COO matrix designated by interface
.
#define STARPU_COO_GET_NX | ( | interface | ) |
Return the number of elements on the x-axis of the matrix designated by interface
.
#define STARPU_COO_GET_NY | ( | interface | ) |
Return the number of elements on the y-axis of the matrix designated by interface
.
#define STARPU_COO_GET_NVALUES | ( | interface | ) |
Return the number of values registered in the matrix designated by interface
.
#define STARPU_COO_GET_ELEMSIZE | ( | interface | ) |
Return the size of the elements registered into the matrix designated by interface
.
Identifier for all predefined StarPU data interfaces
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.
void starpu_variable_data_register | ( | starpu_data_handle_t * | handle, |
unsigned | 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.
void starpu_vector_data_register | ( | starpu_data_handle_t * | handle, |
unsigned | 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.
void starpu_matrix_data_register | ( | starpu_data_handle_t * | handle, |
unsigned | 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.
void starpu_block_data_register | ( | starpu_data_handle_t * | handle, |
unsigned | 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.
void starpu_bcsr_data_register | ( | starpu_data_handle_t * | handle, |
unsigned | 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
[i] is the block-column index for block i in nzval
, rowptr
[i] is the block-index (in nzval
) of the first block of row i. firstentry
is the index of the first entry of the given arrays (usually 0 or 1).
void starpu_csr_data_register | ( | starpu_data_handle_t * | handle, |
unsigned | home_node, | ||
uint32_t | nnz, | ||
uint32_t | nrow, | ||
uintptr_t | nzval, | ||
uint32_t * | colind, | ||
uint32_t * | rowptr, | ||
uint32_t | firstentry, | ||
size_t | elemsize | ||
) |
This variant of starpu_data_register() uses the CSR (Compressed Sparse Row Representation) sparse matrix interface. TODO
void starpu_coo_data_register | ( | starpu_data_handle_t * | handleptr, |
unsigned | 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
.
void * starpu_data_get_interface_on_node | ( | starpu_data_handle_t | handle, |
unsigned | memory_node | ||
) |
Return the interface associated with handle
on memory_node
.
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
.
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 data allocated locally
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
.
size_t starpu_data_get_size | ( | starpu_data_handle_t | handle | ) |
Return the size of the data associated with handle
.
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.
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). The memory at the address ptr
is freed after calling the data unpacking operation.
size_t starpu_variable_get_elemsize | ( | starpu_data_handle_t | handle | ) |
Return the size of the variable designated by handle
.
uintptr_t starpu_variable_get_local_ptr | ( | starpu_data_handle_t | handle | ) |
Return a pointer to the variable designated by handle
.
uint32_t starpu_vector_get_nx | ( | starpu_data_handle_t | handle | ) |
Return the number of elements registered into the array designated by handle
.
size_t starpu_vector_get_elemsize | ( | starpu_data_handle_t | handle | ) |
Return the size of each element of the array designated by handle
.
uintptr_t starpu_vector_get_local_ptr | ( | starpu_data_handle_t | handle | ) |
Return the local pointer associated with handle
.
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
.
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
.
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.
uintptr_t starpu_matrix_get_local_ptr | ( | starpu_data_handle_t | handle | ) |
Return the local pointer associated with handle
.
size_t starpu_matrix_get_elemsize | ( | starpu_data_handle_t | handle | ) |
Return the size of the elements registered into the matrix designated by handle
.
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
.
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
.
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
.
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.
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.
uintptr_t starpu_block_get_local_ptr | ( | starpu_data_handle_t | handle | ) |
Return the local pointer associated with handle
.
size_t starpu_block_get_elemsize | ( | starpu_data_handle_t | handle | ) |
Return the size of the elements of the block designated by handle
.
uint32_t starpu_bcsr_get_nnz | ( | starpu_data_handle_t | handle | ) |
Return the number of non-zero elements in the matrix designated by handle
.
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
.
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
.
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
.
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
.
uint32_t * starpu_bcsr_get_local_rowptr | ( | starpu_data_handle_t | handle | ) |
Return the row pointer array of the matrix designated by handle
.
uint32_t starpu_bcsr_get_r | ( | starpu_data_handle_t | handle | ) |
Return the number of rows in a block.
uint32_t starpu_bcsr_get_c | ( | starpu_data_handle_t | handle | ) |
Return the numberof columns in a block.
size_t starpu_bcsr_get_elemsize | ( | starpu_data_handle_t | handle | ) |
Return the size of the elements in the matrix designated by handle
.
uint32_t starpu_csr_get_nnz | ( | starpu_data_handle_t | handle | ) |
Return the number of non-zero values in the matrix designated by handle
.
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
.
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
.
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
.
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
.
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
.
size_t starpu_csr_get_elemsize | ( | starpu_data_handle_t | handle | ) |
Return the size of the elements registered into the matrix designated by handle
.
uintptr_t starpu_malloc_on_node | ( | unsigned | dst_node, |
size_t | size | ||
) |
Allocate size
bytes on node dst_node
. This returns 0 if allocation failed, the allocation method should then return -ENOMEM
as allocated size.
void starpu_free_on_node | ( | unsigned | dst_node, |
uintptr_t | addr, | ||
size_t | size | ||
) |
Free addr
of size
bytes on node dst_node
.
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 any_to_any() copy method, which is provided with the 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.
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.
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.
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.
int starpu_data_interface_get_next_id | ( | void | ) |
Return the next available id for a newly created data interface (Defining A New Data Interface).