pub struct Config {
    pub dedicated_threshold: u64,
    pub preferred_dedicated_threshold: u64,
    pub transient_dedicated_threshold: u64,
    pub starting_free_list_chunk: u64,
    pub final_free_list_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.

starting_free_list_chunk: u64

Size in bytes of first chunk in free-list allocator.

final_free_list_chunk: u64

Upper limit for size in bytes of chunks in free-list 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

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).

Returns default configuration for average sized potato.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.