starpu_data_filter

Struct starpu_data_filter 

Source
#[repr(C)]
pub struct starpu_data_filter { pub filter_func: Option<unsafe extern "C" fn(father_interface: *mut c_void, child_interface: *mut c_void, arg1: *mut starpu_data_filter, id: c_uint, nparts: c_uint)>, pub nchildren: c_uint, pub get_nchildren: Option<unsafe extern "C" fn(arg1: *mut starpu_data_filter, initial_handle: starpu_data_handle_t) -> c_uint>, pub get_child_ops: Option<unsafe extern "C" fn(arg1: *mut starpu_data_filter, id: c_uint) -> *mut starpu_data_interface_ops>, pub filter_arg: c_uint, pub filter_arg_ptr: *mut c_void, }
Expand description

Describe a data partitioning operation, to be given to starpu_data_partition(). See \ref DefiningANewDataFilter for more details.

Fields§

§filter_func: Option<unsafe extern "C" fn(father_interface: *mut c_void, child_interface: *mut c_void, arg1: *mut starpu_data_filter, id: c_uint, nparts: c_uint)>

Fill the \p child_interface structure with interface information for the \p i -th child of the parent \p father_interface (among \p nparts). The \p filter structure is provided, allowing to inspect the starpu_data_filter::filter_arg and starpu_data_filter::filter_arg_ptr parameters. The details of what needs to be filled in \p child_interface vary according to the data interface, but generally speaking:

  • id is usually just copied over from the father, when the sub data has the same structure as the father, e.g. a subvector is a vector, a submatrix is a matrix, etc. This is however not the case for instance when dividing a BCSR matrix into its dense blocks, which then are matrices.
  • nx, ny and alike are usually divided by the number of subdata, depending how the subdivision is done (e.g. nx division vs ny division for vertical matrix division vs horizontal matrix division).
  • ld for matrix interfaces are usually just copied over: the leading dimension (ld) usually does not change.
  • elemsize is usually just copied over.
  • ptr, the pointer to the data, has to be computed according to \p i and the father's ptr, so as to point to the start of the sub data. This should however be done only if the father has ptr different from NULL: in the OpenCL case notably, the dev_handle and offset fields are used instead.
  • dev_handle should be just copied over from the parent.
  • offset has to be computed according to \p i and the father's offset, so as to provide the offset of the start of the sub data. This is notably used for the OpenCL case.
§nchildren: c_uint

< Number of parts to partition the data into.

§get_nchildren: Option<unsafe extern "C" fn(arg1: *mut starpu_data_filter, initial_handle: starpu_data_handle_t) -> c_uint>

Return the number of children. This can be used instead of starpu_data_filter::nchildren when the number of children depends on the actual data (e.g. the number of blocks in a sparse matrix).

§get_child_ops: Option<unsafe extern "C" fn(arg1: *mut starpu_data_filter, id: c_uint) -> *mut starpu_data_interface_ops>

When children use different data interface, return which interface is used by child number \p id.

§filter_arg: c_uint

< Additional parameter for the filter function

§filter_arg_ptr: *mut c_void

Additional pointer parameter for the filter function, such as the sizes of the different parts.

Trait Implementations§

Source§

impl Clone for starpu_data_filter

Source§

fn clone(&self) -> starpu_data_filter

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_filter

Source§

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

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

impl Default for starpu_data_filter

Source§

fn default() -> Self

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

impl Copy for starpu_data_filter

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.