pub struct CudaUnifiedIterator2<'a, R: Copy + DeviceCopy, S: Copy + DeviceCopy> { /* private fields */ }
Expand description

CUDA iterator for two mutable unified memory inputs.

Prefetches data from main-memory to device memory on a chunk-sized granularity.

Preconditions

All inputs are required to have the same length.

Thread safety

Only one CPU thread is used within the iterator, thus thread-safety only applies to the CUDA kernel. See the fold() documentation for details.

Implementations

Apply a GPU function that produces a single, final value.

fold() takes two arguments: a data value, and a CUDA stream. In the case of CudaUnifiedIterator2, the data value is specified as a two-tuple of launchable slices. The slices are guaranteed to have the same length.

The function passed to fold() is meant to launch a CUDA kernel function on the given CUDA stream.

In contrast to Rust’s standard library fold() iterator, the state in this iterator is implicit in GPU memory.

Thread safety

Prefetching and kernel execution are asynchronous operations. They are performed on two or more CUDA streams to achieve parallelism, i.e.. prefetching and execution overlap.

However, Rust cannot guarantee thread-safety of CUDA kernels. Thus, the user must ensure that the CUDA kernels are safe to execute on multiple CUDA streams, e.g. by using atomic operations when accessing device memory.

Trait Implementations

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