Struct gpu_alloc::Config[][src]

pub struct Config {
    pub dedicated_threshold: u64,
    pub preferred_dedicated_threshold: u64,
    pub transient_dedicated_threshold: u64,
    pub linear_chunk: u64,
    pub minimal_buddy_size: u64,
    pub initial_buddy_dedicated_size: u64,
}
Expand description

Configuration for GpuAllocator

Fields

dedicated_threshold: u64

Size in bytes of request that will be served by dedicated memory object. This value should be large enough to not exhaust memory object limit and not use slow memory object allocation when it is not necessary.

preferred_dedicated_threshold: u64

Size in bytes of request that will be served by dedicated memory object if preferred. This value should be large enough to not exhaust memory object limit and not use slow memory object allocation when it is not necessary.

This won’t make much sense if this value is larger than dedicated_threshold.

transient_dedicated_threshold: u64

Size in bytes of transient memory request that will be served by dedicated memory object. This value should be large enough to not exhaust memory object limit and not use slow memory object allocation when it is not necessary.

This won’t make much sense if this value is lesser than dedicated_threshold.

linear_chunk: u64

Size in bytes for chunks for linear allocator.

minimal_buddy_size: u64

Minimal size for buddy allocator.

initial_buddy_dedicated_size: u64

Initial memory object size for buddy allocator. If less than minimal_buddy_size then minimal_buddy_size is used instead.

Implementations

impl Config[src]

pub fn i_am_prototyping() -> Self[src]

Returns default configuration.

This is not Default implementation to discourage usage outside of prototyping.

Proper configuration should depend on hardware and intended usage.
But those values can be used as starting point.
Note that they can simply not work for some platforms with lesser memory capacity than today’s “modern” GPU (year 2020).

pub fn i_am_potato() -> Self[src]

Returns default configuration for average sized potato.

Trait Implementations

impl Clone for Config[src]

fn clone(&self) -> Config[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Config[src]

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

Formats the value using the given formatter. Read more

impl PartialEq<Config> for Config[src]

fn eq(&self, other: &Config) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Config) -> bool[src]

This method tests for !=.

impl Copy for Config[src]

impl Eq for Config[src]

impl StructuralEq for Config[src]

impl StructuralPartialEq for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.