For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
GitHubCUDA-X
    • Home
    • Installation
  • Getting Started
    • Introduction
    • Integrations
    • Use-cases
  • User Guide
    • API Guide
    • Benchmarking Guide
    • Compatibility
    • Integration Patterns
    • Advanced Topics
    • References
  • Developer Guide
    • Coding Guidelines
    • ABI Stability
    • Link-time Optimization
    • Contributing
  • API Reference
    • C API Documentation
    • Cpp API Documentation
      • Cluster Agglomerative
      • Cluster Kmeans
      • Cluster Spectral
      • Common Types
        • Execution Resources
        • Dense Array Views
        • Dense View Factories
        • Owning Dense Arrays
        • Owning Array Factories
        • Layouts and Extents
        • Sparse Array Types
        • Copy, Serialization, and Utility APIs
        • Errors and Logging
      • Distance Distance
      • Distance Grammian
      • Neighbors All Neighbors
      • Neighbors Ball Cover
      • Neighbors Brute Force
      • Neighbors Cagra
      • Neighbors Common
      • Neighbors Dynamic Batching
      • Neighbors Epsilon Neighborhood
      • Neighbors HNSW
      • Neighbors Composite Index
      • Neighbors IVF Flat
      • Neighbors IVF PQ
      • Neighbors NN Descent
      • Neighbors Refine
      • Neighbors Scann
      • Neighbors Tiered Index
      • Neighbors Vamana
      • Preprocessing Quantize Binary
      • Preprocessing PCA
      • Preprocessing Quantize PQ
      • Preprocessing Quantize Scalar
      • Preprocessing Spectral Embedding
      • Selection Select K
      • Stats Silhouette Score
      • Stats Trustworthiness Score
      • Util Cutlass Utils
      • Util File Io
    • Python API Documentation
    • Java API Documentation
    • Rust API Documentation
    • Go API Documentation
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogocuVS
GitHubCUDA-X
On this page
  • raft::copy
  • raft::copy_matrix
  • raft::update_device
  • raft::update_host
  • raft::serialize_mdspan
  • raft::deserialize_mdspan
  • raft::ceildiv
  • raft::round_up_safe
API ReferenceCpp API DocumentationCommon Types

Copy, Serialization, and Utility APIs

||View as Markdown|
Previous

Sparse Array Types

Next

Errors and Logging

raft::copy

Source header: raft/core/copy.hpp

Asynchronously copies elements between compatible memory locations.

1template <typename OutputIterator, typename InputIterator, typename SizeType>
2void copy(OutputIterator dst, InputIterator src, SizeType n,
3 rmm::cuda_stream_view stream);

Parameters

NameTypeDescription
dstOutputIteratorDestination pointer or iterator.
srcInputIteratorSource pointer or iterator.
nSizeTypeNumber of elements to copy.
streamrmm::cuda_stream_viewCUDA stream used for the copy.

Returns

void

raft::copy_matrix

Source header: raft/core/copy.hpp

Copies a dense matrix between compatible matrix views.

1template <typename OutputView, typename InputView>
2void copy_matrix(OutputView dst, InputView src, rmm::cuda_stream_view stream);

Parameters

NameTypeDescription
dstOutputViewDestination matrix view.
srcInputViewSource matrix view.
streamrmm::cuda_stream_viewCUDA stream used for the copy.

Returns

void

raft::update_device

Source header: raft/core/copy.hpp

Convenience helper for copying host data to device memory.

1template <typename DevicePointer, typename HostPointer, typename SizeType>
2void update_device(DevicePointer dst, HostPointer src, SizeType n,
3 rmm::cuda_stream_view stream);

Parameters

NameTypeDescription
dstDevicePointerDestination device pointer.
srcHostPointerSource host pointer.
nSizeTypeNumber of elements to copy.
streamrmm::cuda_stream_viewCUDA stream used for the copy.

Returns

void

raft::update_host

Source header: raft/core/copy.hpp

Convenience helper for copying device data to host memory.

1template <typename HostPointer, typename DevicePointer, typename SizeType>
2void update_host(HostPointer dst, DevicePointer src, SizeType n,
3 rmm::cuda_stream_view stream);

Parameters

NameTypeDescription
dstHostPointerDestination host pointer.
srcDevicePointerSource device pointer.
nSizeTypeNumber of elements to copy.
streamrmm::cuda_stream_viewCUDA stream used for the copy.

Returns

void

raft::serialize_mdspan

Source header: raft/core/serialize.hpp

Serializes array contents from an mdspan-like view.

1template <typename View>
2void serialize_mdspan(std::ostream& os, View view);

Parameters

NameTypeDescription
osstd::ostream&Output stream.
viewViewView whose contents should be serialized.

Returns

void

raft::deserialize_mdspan

Source header: raft/core/serialize.hpp

Deserializes array contents into an mdspan-like view.

1template <typename View>
2void deserialize_mdspan(std::istream& is, View view);

Parameters

NameTypeDescription
isstd::istream&Input stream.
viewViewDestination view.

Returns

void

raft::ceildiv

Source header: raft/util/integer_utils.hpp

Computes integer division rounded up.

1template <typename T>
2T ceildiv(T dividend, T divisor);

Parameters

NameTypeDescription
dividendTDividend.
divisorTDivisor.

Returns

T

raft::round_up_safe

Source header: raft/util/integer_utils.hpp

Rounds an integer value up to a requested multiple.

1template <typename T>
2T round_up_safe(T value, T multiple);

Parameters

NameTypeDescription
valueTValue to round.
multipleTMultiple to round to.

Returns

T