Skip to main content

gather

Function gather 

Source
pub fn gather(
    ctx: &Context,
    sparse_vector: &mut SparseVectorDescriptor<'_>,
    dense_vector: &DenseVectorDescriptor<'_>,
) -> Result<()>
Expand description

Gathers the elements of dense_vector into sparse_vector.

In other words,

for i=0 to nnz-1
sparse_values[i] = dense_values[sparse_indices[i]]

gather supports the following index type for representing sparse_vector:

gather supports the following data types:

gather has the following constraints:

  • The arrays representing sparse_vector must be aligned to 16 bytes.

gather has the following properties:

  • Requires no extra storage.
  • Supports asynchronous execution.
  • Provides deterministic (bitwise) results for each run if sparse_vector indices are distinct.
  • Allows the indices of sparse_vector to be unsorted.

gather supports the following optimizations:

  • CUDA graph capture.
  • Hardware Memory Compression.