Owning Array Factories

View as Markdown

raft::make_device_matrix

Source header: raft/core/device_mdarray.hpp

Allocates an owning device matrix.

1template <typename ElementType, typename IndexType, typename LayoutPolicy>
2auto make_device_matrix(raft::resources const& res, IndexType rows, IndexType cols);

Parameters

NameTypeDescription
resraft::resources const&Resources object used for allocation.
rowsIndexTypeNumber of rows.
colsIndexTypeNumber of columns.

Returns

raft::device_matrix<ElementType, IndexType, LayoutPolicy>

raft::make_device_vector

Source header: raft/core/device_mdarray.hpp

Allocates an owning device vector.

1template <typename ElementType, typename IndexType, typename LayoutPolicy>
2auto make_device_vector(raft::resources const& res, IndexType size);

Parameters

NameTypeDescription
resraft::resources const&Resources object used for allocation.
sizeIndexTypeNumber of elements.

Returns

raft::device_vector<ElementType, IndexType, LayoutPolicy>

raft::make_host_matrix

Source header: raft/core/host_mdarray.hpp

Allocates an owning host matrix.

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

Parameters

NameTypeDescription
rowsIndexTypeNumber of rows.
colsIndexTypeNumber of columns.

Returns

raft::host_matrix<ElementType, IndexType, LayoutPolicy>

raft::make_host_vector

Source header: raft/core/host_mdarray.hpp

Allocates an owning host vector.

1template <typename ElementType, typename IndexType, typename LayoutPolicy>
2auto make_host_vector(IndexType size);

Parameters

NameTypeDescription
sizeIndexTypeNumber of elements.

Returns

raft::host_vector<ElementType, IndexType, LayoutPolicy>