pub fn scatter(
ctx: &Context,
sparse_vector: &SparseVectorDescriptor<'_>,
dense_vector: &mut DenseVectorDescriptor<'_>,
) -> Result<()>Expand description
Scatters the elements of sparse_vector into dense_vector.
In other words,
for i=0 to nnz-1
dense_values[sparse_indices[i]] = sparse_values[i]scatter supports the following index type for representing sparse_vector:
- 32-bit indices (
IndexType::I32) - 64-bit indices (
IndexType::I64)
scatter supports the following data types:
X/Y | Notes |
|---|---|
DataType::I8 | |
DataType::F16 | |
DataType::Bf16 | |
DataType::F32 | |
DataType::F64 | |
DataType::ComplexF16 | Deprecated. |
DataType::ComplexBf16 | Deprecated. |
DataType::ComplexF32 | |
DataType::ComplexF64 |
scatter has the following constraints:
- The arrays representing
sparse_vectormust be aligned to 16 bytes.
scatter 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.
scatter supports the following optimizations:
- CUDA graph capture.
- Hardware Memory Compression.