pub trait IntoCudaIteratorWithStrategy<'a> {
    type Iter;
    fn into_cuda_iter_with_strategy(
        &'a mut self,
        strategy: CudaTransferStrategy,
        chunk_len: usize,
        cpu_memcpy_threads: usize,
        cpu_affinity: &CpuAffinity
    ) -> Result<Self::Iter>; }
Expand description

Conversion into a CUDA iterator with a specified transfer strategy.

By implementing IntoCudaIteratorWithStrategy for a type, you define how the type is converted into an iterator capable of executing CUDA functions on a GPU.

strategy specifies which transfer strategy to use. See the CudaTransferStrategy documation for details. The iterator must implement all strategies.

The chunk_len parameter specifies the granularity of each data transfer from main-memory to device memory. The same granularity is used when passing input parameters to the GPU kernel.

Associated Types

The type of the iterator to produce.

Required methods

Creates an iterator from a value.

See the module-level documentation for details.

Implementations on Foreign Types

Converts a tuple of two mutable slices into a CUDA iterator.

The slices must be mutable (and cannot be read-only) because transfer strategies can be implemented using a parallel pipeline. Parallelism requires exclusive access to data for Rust to successfully type-check. In Rust, holding a mutable reference guarantees exclusive access, because only a single mutable reference can exist at any point in time.

The slices can have mutually distinct lifetimes. However, the lifetime of the resulting iterator must be shorter than that of the shortest slice lifetime.

This implementation should be used as a basis for future implementations for other tuples of slices (e.g., one slice, three slices, etc.).

Implementors