Skip to main content

starpu_perfmodel

Struct starpu_perfmodel 

Source
#[repr(C)]
pub struct starpu_perfmodel {
Show 17 fields pub type_: starpu_perfmodel_type, pub cost_function: Option<unsafe extern "C" fn(arg1: *mut starpu_task, nimpl: c_uint) -> f64>, pub arch_cost_function: Option<unsafe extern "C" fn(arg1: *mut starpu_task, arch: *mut starpu_perfmodel_arch, nimpl: c_uint) -> f64>, pub worker_cost_function: Option<unsafe extern "C" fn(arg1: *mut starpu_task, workerid: c_uint, nimpl: c_uint) -> f64>, pub size_base: Option<unsafe extern "C" fn(arg1: *mut starpu_task, nimpl: c_uint) -> usize>, pub footprint: Option<unsafe extern "C" fn(arg1: *mut starpu_task) -> u32>, pub symbol: *const c_char, pub path: *mut c_char, pub is_loaded: c_uint, pub benchmarking: c_uint, pub is_init: c_uint, pub parameters: Option<unsafe extern "C" fn(task: *mut starpu_task, parameters: *mut f64)>, pub parameters_names: *mut *const c_char, pub nparameters: c_uint, pub combinations: *mut *mut c_uint, pub ncombinations: c_uint, pub state: starpu_perfmodel_state_t,
}
Expand description

Contain all information about a performance model. At least the type and symbol fields have to be filled when defining a performance model for a codelet. For compatibility, make sure to initialize the whole structure to zero, either by using explicit memset, or by letting the compiler implicitly do it in e.g. static storage case. If not provided, other fields have to be zero.

Fields§

§type_: starpu_perfmodel_type

type of performance model

  • ::STARPU_HISTORY_BASED, ::STARPU_REGRESSION_BASED, ::STARPU_NL_REGRESSION_BASED: No other fields needs to be provided, this is purely history-based.
  • ::STARPU_MULTIPLE_REGRESSION_BASED: Need to provide fields starpu_perfmodel::nparameters (number of different parameters), starpu_perfmodel::ncombinations (number of parameters combinations-tuples) and table starpu_perfmodel::combinations which defines exponents of the equation. Function cl_perf_func also needs to define how to extract parameters from the task.
  • ::STARPU_PER_ARCH: either field starpu_perfmodel::arch_cost_function has to be filled with a function that returns the cost in micro-seconds on the arch given as parameter, or field starpu_perfmodel::per_arch has to be filled with functions which return the cost in micro-seconds.
  • ::STARPU_COMMON: field starpu_perfmodel::cost_function has to be filled with a function that returns the cost in micro-seconds on a CPU, timing on other archs will be determined by multiplying by an arch-specific factor.
§cost_function: Option<unsafe extern "C" fn(arg1: *mut starpu_task, nimpl: c_uint) -> f64>

Used by ::STARPU_COMMON. Take a task and implementation number, and must return a task duration estimation in micro-seconds.

§arch_cost_function: Option<unsafe extern "C" fn(arg1: *mut starpu_task, arch: *mut starpu_perfmodel_arch, nimpl: c_uint) -> f64>

Used by ::STARPU_PER_ARCH. Take a task, an arch and implementation number, and must return a task duration estimation in micro-seconds on that arch.

§worker_cost_function: Option<unsafe extern "C" fn(arg1: *mut starpu_task, workerid: c_uint, nimpl: c_uint) -> f64>

Used by ::STARPU_PER_WORKER. Take a task, a worker id and implementation number, and must return a task duration estimation in micro-seconds on that worker.

§size_base: Option<unsafe extern "C" fn(arg1: *mut starpu_task, nimpl: c_uint) -> usize>

Used by ::STARPU_HISTORY_BASED, ::STARPU_REGRESSION_BASED and ::STARPU_NL_REGRESSION_BASED. If not NULL, take a task and implementation number, and return the size to be used as index to distinguish histories and as a base for regressions.

§footprint: Option<unsafe extern "C" fn(arg1: *mut starpu_task) -> u32>

Used by ::STARPU_HISTORY_BASED. If not NULL, take a task and return the footprint to be used as index to distinguish histories. The default is to use the starpu_task_data_footprint() function.

§symbol: *const c_char

symbol name for the performance model, which will be used as file name to store the model. It must be set otherwise the model will be ignored.

§path: *mut c_char

name of the file storing the performance model. It is non NULL if the model has been loaded or stored in a file.

§is_loaded: c_uint

\private Whether the performance model is already loaded from the disk.

§benchmarking: c_uint

\private

§is_init: c_uint

\private

§parameters: Option<unsafe extern "C" fn(task: *mut starpu_task, parameters: *mut f64)>§parameters_names: *mut *const c_char

\private Names of parameters used for multiple linear regression models (M, N, K)

§nparameters: c_uint

\private Number of parameters used for multiple linear regression models

§combinations: *mut *mut c_uint

\private Table of combinations of parameters (and the exponents) used for multiple linear regression models

§ncombinations: c_uint

\private Number of combination of parameters used for multiple linear regression models

§state: starpu_perfmodel_state_t

\private

Trait Implementations§

Source§

impl Clone for starpu_perfmodel

Source§

fn clone(&self) -> starpu_perfmodel

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_perfmodel

Source§

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

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

impl Default for starpu_perfmodel

Source§

fn default() -> Self

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

impl Copy for starpu_perfmodel

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.