starpu_data_copy_methods

Struct starpu_data_copy_methods 

Source
#[repr(C)]
pub struct starpu_data_copy_methods {
Show 25 fields pub can_copy: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint, handling_node: c_uint) -> c_int>, pub ram_to_ram: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub ram_to_cuda: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub ram_to_hip: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub ram_to_opencl: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub ram_to_max_fpga: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub cuda_to_ram: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub cuda_to_cuda: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub hip_to_ram: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub hip_to_hip: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub opencl_to_ram: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub opencl_to_opencl: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub max_fpga_to_ram: Option<unsafe extern "C" fn(src_interface: *mut c_void, srd_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub ram_to_cuda_async: Option<unsafe extern "C" fn() -> c_int>, pub cuda_to_ram_async: Option<unsafe extern "C" fn() -> c_int>, pub cuda_to_cuda_async: Option<unsafe extern "C" fn() -> c_int>, pub ram_to_hip_async: Option<unsafe extern "C" fn() -> c_int>, pub hip_to_ram_async: Option<unsafe extern "C" fn() -> c_int>, pub hip_to_hip_async: Option<unsafe extern "C" fn() -> c_int>, pub ram_to_opencl_async: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint, event: *mut cl_event) -> c_int>, pub opencl_to_ram_async: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint, event: *mut cl_event) -> c_int>, pub opencl_to_opencl_async: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint, event: *mut cl_event) -> c_int>, pub ram_to_max_fpga_async: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub max_fpga_to_ram_async: Option<unsafe extern "C" fn(src_interface: *mut c_void, srd_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>, pub any_to_any: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint, async_data: *mut c_void) -> c_int>,
}
Expand description

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, HIP or OpenCL support.

See \ref DefiningANewDataInterface_copy for more details.

Fields§

§can_copy: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint, handling_node: c_uint) -> c_int>

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

§ram_to_ram: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§ram_to_cuda: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§ram_to_hip: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§ram_to_opencl: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§ram_to_max_fpga: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§cuda_to_ram: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§cuda_to_cuda: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§hip_to_ram: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§hip_to_hip: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

Define how to copy data from the \p src_interface interface on the \p src_node HIP node to the \p dst_interface interface on the \p dst_node HIP node. Return 0 on success.

§opencl_to_ram: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§opencl_to_opencl: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§max_fpga_to_ram: Option<unsafe extern "C" fn(src_interface: *mut c_void, srd_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

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

§ram_to_cuda_async: Option<unsafe extern "C" fn() -> c_int>§cuda_to_ram_async: Option<unsafe extern "C" fn() -> c_int>§cuda_to_cuda_async: Option<unsafe extern "C" fn() -> c_int>§ram_to_hip_async: Option<unsafe extern "C" fn() -> c_int>§hip_to_ram_async: Option<unsafe extern "C" fn() -> c_int>§hip_to_hip_async: Option<unsafe extern "C" fn() -> c_int>§ram_to_opencl_async: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint, event: *mut cl_event) -> c_int>

Define how to copy data from the \p src_interface interface on the \p src_node CPU node to the \p dst_interface interface on the \p dst_node OpenCL node, by recording in \p 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: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint, event: *mut cl_event) -> c_int>

Define how to copy data from the \p src_interface interface on the \p src_node OpenCL node to the \p dst_interface interface on the \p dst_node CPU node, by recording in \p 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: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint, event: *mut cl_event) -> c_int>

Define how to copy data from the \p src_interface interface on the \p src_node OpenCL node to the \p dst_interface interface on the \p dst_node OpenCL node, by recording in \p 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_max_fpga_async: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

Define how to copy data from the \p src_interface interface on the \p src_node CPU node to the \p dst_interface interface on the \p dst_node FPGA 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.

§max_fpga_to_ram_async: Option<unsafe extern "C" fn(src_interface: *mut c_void, srd_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint) -> c_int>

Define how to copy data from the \p src_interface interface on the \p src_node FPGA node to the \p dst_interface interface on the \p 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: Option<unsafe extern "C" fn(src_interface: *mut c_void, src_node: c_uint, dst_interface: *mut c_void, dst_node: c_uint, async_data: *mut c_void) -> c_int>

Define how to copy data from the \p src_interface interface on the \p src_node node to the \p dst_interface interface on the \p 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::peek_data should be implemented instead, and the core will just transfer the resulting data buffer.

Trait Implementations§

Source§

impl Clone for starpu_data_copy_methods

Source§

fn clone(&self) -> starpu_data_copy_methods

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for starpu_data_copy_methods

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for starpu_data_copy_methods

Source§

fn default() -> starpu_data_copy_methods

Returns the “default value” for a type. Read more
Source§

impl Copy for starpu_data_copy_methods

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.