pub struct Allocator;
Expand description

Heterogeneous memory allocator.

Implementations

Allocates memory of the specified type

Allocates host-dereferencable memory of the specified type

Returns a generic ‘Mem’ memory allocator that allocates memory of the specified ‘Mem’ type.

Returns a generic ‘DerefMem’ memory allocator that allocates memory of the specified ‘DerefMem’ type.

Captures the cache memory type and returns a function that returns an allocator

Effectively, we’re gathering the arguments by currying mem_spill_alloc_fn_internal.

The returned allocator uses GPU memory until cache_max_len is reached. Then, the allocator spills the remainder to CPU memory.

The functional programming approach used here solves the leaky abstraction problem. Oftentimes, the knowledge about how much cache space is available, and the total required space for the data relation reside in two different code modules. Thus, we aggregate this knowledge in a closure to retain modularity, instead of leaking internal details of the modules.

Returns a “future” that is set to the cached length when the allocator is invoked, for logging purposes.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. 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.