StarPU Internal Handbook
Loading...
Searching...
No Matches
node_ops.h File Reference
#include <starpu.h>
#include <common/config.h>
#include <datawizard/copy_driver.h>

Go to the source code of this file.

Data Structures

struct  _starpu_node_ops
 

Typedefs

typedef int(* copy_interface_func_t) (starpu_data_handle_t handle, void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, struct _starpu_data_request *req)
 
typedef int(* copy_data_t) (uintptr_t src_ptr, size_t src_offset, unsigned src_node, uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node, size_t ssize, struct _starpu_async_channel *async_channel)
 
typedef int(* copy2d_data_t) (uintptr_t src_ptr, size_t src_offset, unsigned src_node, uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node, size_t blocksize, size_t numblocks, size_t ld_src, size_t ld_dst, struct _starpu_async_channel *async_channel)
 
typedef int(* copy3d_data_t) (uintptr_t src_ptr, size_t src_offset, unsigned src_node, uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node, size_t blocksize, size_t numblocks_1, size_t ld1_src, size_t ld1_dst, size_t numblocks_2, size_t ld2_src, size_t ld2_dst, struct _starpu_async_channel *async_channel)
 
typedef uintptr_t(* map_t) (uintptr_t src, size_t src_offset, unsigned src_node, unsigned dst_node, size_t size, int *ret)
 
typedef int(* unmap_t) (uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, unsigned dst_node, size_t size)
 
typedef int(* update_map_t) (uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t size)
 

Functions

const char * _starpu_node_get_prefix (enum starpu_node_kind kind)
 

Data Structure Documentation

◆ _starpu_node_ops

struct _starpu_node_ops

Reference all the methods for copying data from this kind of device to another kind of device.

Data Fields
copy_interface_func_t copy_interface_to[STARPU_MAX_RAM+1]

Request copying a data interface from this type of node to another type of node. As a first start, you can just use the generic _starpu_copy_interface_any_to_any.

copy_interface_func_t copy_interface_from[STARPU_MAX_RAM+1]

Request copying a data interface to this type of node from another type of node. As a first start, you can just use the generic _starpu_copy_interface_any_to_any.

copy_data_t copy_data_to[STARPU_MAX_RAM+1]

Request copying a piece of data from this type of node to another type of node. This method is required at least for STARPU_CPU_RAM.

copy_data_t copy_data_from[STARPU_MAX_RAM+1]

Request copying a piece of data to this type of node from another type of node. This method is required at least for STARPU_CPU_RAM.

copy2d_data_t copy2d_data_to[STARPU_MAX_RAM+1]

Request copying a 2D piece of data (i.e. matrix tile with an ld) from this type of node to another type of node. This method is optional.

copy2d_data_t copy2d_data_from[STARPU_MAX_RAM+1]

Request copying a 2D piece of data (i.e. matrix tile with an ld) to this type of node from another type of node. This method is optional.

copy3d_data_t copy3d_data_to[STARPU_MAX_RAM+1]

Request copying a 3D piece of data (i.e. block piece with ldy and ldz) from this type of node to another type of node. This method is optional.

copy3d_data_t copy3d_data_from[STARPU_MAX_RAM+1]

Request copying a 3D piece of data (i.e. block piece with ldy and ldz) to this type of node from another type of node. This method is optional.

void(*)(struct _starpu_async_channel *async_channel) wait_request_completion

Wait for the completion of asynchronous request async_channel.

unsigned(*)(struct _starpu_async_channel *async_channel) test_request_completion

Test whether asynchronous request async_channel has completed.

int(*)(unsigned node, unsigned handling_node) is_direct_access_supported

Return whether inter-device transfers are possible between node and handling_node. If this returns 0, copy_interface_to will always be called with CPU RAM as either source or destination. If this returns 1, copy_interface_to may be called with both source and destination in device memory.

handling_node is the node that will initiate the transfer. This allows to prefer starting from the driver itself.

uintptr_t(*)(unsigned dst_node, size_t size, int flags) malloc_on_node

Allocate size bytes of data on node dst_node. flags can contain STARPU_MALLOC_* flags, only useful for CPU memory

void(*)(unsigned dst_node, uintptr_t addr, size_t size, int flags) free_on_node

Free data addr, which was a previous allocation of size bytes of data on node dst_node with flags flags

map_t map[STARPU_MAX_RAM+1]

Map data a piece of data to this type of node from another type of node. This method is optional

unmap_t unmap[STARPU_MAX_RAM+1]

Unmap data a piece of data to this type of node from another type of node. This method is optional

update_map_t update_map[STARPU_MAX_RAM+1]

Update cache coherency for the mapping of a piece of data to this type of node from another type of node. This method is optional

char * name

Name of the type of memory, for debugging

Typedef Documentation

◆ copy_interface_func_t

typedef int(* copy_interface_func_t) (starpu_data_handle_t handle, void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, struct _starpu_data_request *req)

Request copying some data interface for handle handle: from interface src_interface that exists on node src_node to interface dst_interface that exists on node dst_node.

If req is non-NULL, this can be used to start an asynchronous copy, in which case -EAGAIN should be returned. Otherwise, 0 should be returned.

_starpu_copy_interface_any_to_any can be used as a generic version, that assumes that the data_interface implements the any_to_any method, and copy_data_t will be used to queue the actual transfers.

◆ copy_data_t

typedef int(* copy_data_t) (uintptr_t src_ptr, size_t src_offset, unsigned src_node, uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node, size_t ssize, struct _starpu_async_channel *async_channel)

Request copying ssize bytes of data from src_ptr (plus offset src_offset) in node src_node to dst_ptr (plus offset dst_offset) in node dst_node.

If async_channel is non-NULL, this can be used to start an asynchronous copy, in which case -EAGAIN should be returned. Otherwise, 0 should be returned.

◆ copy2d_data_t

typedef int(* copy2d_data_t) (uintptr_t src_ptr, size_t src_offset, unsigned src_node, uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node, size_t blocksize, size_t numblocks, size_t ld_src, size_t ld_dst, struct _starpu_async_channel *async_channel)

This is like copy_data_t, except that there are numblocks blocks of size blocksize bytes to be transferred. On the source, their respective starts are ld_src bytes apart, and on the destination their respective starts have to be ld_dst bytes apart. (leading dimension)

◆ copy3d_data_t

typedef int(* copy3d_data_t) (uintptr_t src_ptr, size_t src_offset, unsigned src_node, uintptr_t dst_ptr, size_t dst_offset, unsigned dst_node, size_t blocksize, size_t numblocks_1, size_t ld1_src, size_t ld1_dst, size_t numblocks_2, size_t ld2_src, size_t ld2_dst, struct _starpu_async_channel *async_channel)

This is like copy_data_t, except that there are numblocks_2 metablocks to be transferred. On the source, their respective starts are ld2_src bytes apart, and on the destination their respective starts have to be ld2_dst bytes apart.

The metablocks are composed of numblocks_1 blocks of size blocksize bytes. On the source, their respective starts are ld1_src bytes apart, and on the destination their respective starts have to be ld1_dst bytes apart.

◆ map_t

typedef uintptr_t(* map_t) (uintptr_t src, size_t src_offset, unsigned src_node, unsigned dst_node, size_t size, int *ret)

Map size bytes of data from src (plus offset src_offset) in node src_node on node dst_node. If successful, return the resulting pointer, otherwise fill *ret

◆ unmap_t

typedef int(* unmap_t) (uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, unsigned dst_node, size_t size)

Unmap size bytes of data from src (plus offset src_offset) in node src_node on node dst_node.

◆ update_map_t

typedef int(* update_map_t) (uintptr_t src, size_t src_offset, unsigned src_node, uintptr_t dst, size_t dst_offset, unsigned dst_node, size_t size)

Update cache coherency for the mapping of size bytes of data from src (plus offset src_offset) in node src_node on node dst_node.