Copy, Serialization, and Utility APIs

View as Markdown

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