Dense View Factories

View as Markdown

raft::make_device_matrix_view

Source header: raft/core/device_mdspan.hpp

Constructs a device matrix view from a pointer and shape.

1template <typename ElementType, typename IndexType, typename LayoutPolicy>
2auto make_device_matrix_view(ElementType* ptr, IndexType rows, IndexType cols);

Parameters

NameTypeDescription
ptrElementType*Pointer to device-accessible matrix storage.
rowsIndexTypeNumber of rows.
colsIndexTypeNumber of columns.

Returns

raft::device_matrix_view<ElementType, IndexType, LayoutPolicy>

raft::make_device_vector_view

Source header: raft/core/device_mdspan.hpp

Constructs a device vector view from a pointer and size.

1template <typename ElementType, typename IndexType, typename LayoutPolicy>
2auto make_device_vector_view(ElementType* ptr, IndexType size);

Parameters

NameTypeDescription
ptrElementType*Pointer to device-accessible vector storage.
sizeIndexTypeNumber of elements.

Returns

raft::device_vector_view<ElementType, IndexType, LayoutPolicy>

raft::make_host_matrix_view

Source header: raft/core/host_mdspan.hpp

Constructs a host matrix view from a pointer and shape.

1template <typename ElementType, typename IndexType, typename LayoutPolicy>
2auto make_host_matrix_view(ElementType* ptr, IndexType rows, IndexType cols);

Parameters

NameTypeDescription
ptrElementType*Pointer to host matrix storage.
rowsIndexTypeNumber of rows.
colsIndexTypeNumber of columns.

Returns

raft::host_matrix_view<ElementType, IndexType, LayoutPolicy>

raft::make_host_vector_view

Source header: raft/core/host_mdspan.hpp

Constructs a host vector view from a pointer and size.

1template <typename ElementType, typename IndexType, typename LayoutPolicy>
2auto make_host_vector_view(ElementType* ptr, IndexType size);

Parameters

NameTypeDescription
ptrElementType*Pointer to host vector storage.
sizeIndexTypeNumber of elements.

Returns

raft::host_vector_view<ElementType, IndexType, LayoutPolicy>

raft::make_const_mdspan

Source header: raft/core/mdspan.hpp

Converts a mutable mdspan-like view into a const view.

1template <typename View>
2auto make_const_mdspan(View view);

Parameters

NameTypeDescription
viewViewView to convert to a const view.

Returns

View with const element type