pub enum CudaTransferStrategy {
    PageableCopy,
    PinnedCopy,
    LazyPinnedCopy,
    Coherence,
}
Expand description

Specify the CUDA transfer strategy.

Defines which strategy with which to transfer data from main-memory to device memory.

A Prefetch strategy is not defined, because cuda_prefetch_async() requires unified memory allocated with cuda_malloc_managed(). Thus, regular memory that is allocated with the system allocator cannot be used in conjunction with prefetching. As unified memory is more specific than the general system memory, prefetching is handled separately using IntoCudaIterator.

Variants

PageableCopy

Copy directly from pageable memory.

Transfers data using cuda_memcopy() directly from the specified memory location. No intermediate steps are performed.

This strategy can also transfer memory that is pinned by the user before the transfer.

PinnedCopy

Copy using an intermediate, pinned buffer.

The transfer first copies data from its original location into a pinned buffer. Then data is transferred using cuda_memcpy().

In principle, this strategy can also tranfer from a pinned memory location. However, the PageableCopy strategy would avoid the additional overhead incurred by the intermediate buffer.

LazyPinnedCopy

Pin the memory in-place and the copy.

The transfer first pins the memory in-place using cuda_host_register(). Then the data is transferred using cuda_memcpy().

Don’t use this strategy with a pinned memory location, as calling cuda_host_register() on a pinned location is probably undefined behavior.

Coherence

Access the memory in-place without any copies.

Requires that the GPU has cache-coherent access to main-memory. E.g., POWER9 and Tesla V100 with NVLink 2.0.

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

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