#[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'sptr , so as to point to the start of the sub data. This should however be done only if the father hasptr different from NULL: in the OpenCL case notably, thedev_handle andoffset 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'soffset , 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_voidAdditional pointer parameter for the filter function, such as the sizes of the different parts.
Trait Implementations§
Source§impl Clone for starpu_data_filter
impl Clone for starpu_data_filter
Source§fn clone(&self) -> starpu_data_filter
fn clone(&self) -> starpu_data_filter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more