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:
- 32-bit indices (
IndexType::I32) - 64-bit indices (
IndexType::I64)
gather supports the following data types:
X/Y | Notes |
|---|---|
DataType::F16 | |
DataType::Bf16 | |
DataType::F32 | |
DataType::F64 | |
DataType::ComplexF16 | Deprecated. |
DataType::ComplexBf16 | Deprecated. |
DataType::ComplexF32 | |
DataType::ComplexF64 |
gather has the following constraints:
- The arrays representing
sparse_vectormust 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_vectorindices are distinct. - Allows the indices of
sparse_vectorto be unsorted.
gather supports the following optimizations:
- CUDA graph capture.
- Hardware Memory Compression.