Attention

The vector search and clustering algorithms in RAFT are being migrated to a new library dedicated to vector search called cuVS. We will continue to support the vector search algorithms in RAFT during this move, but will no longer update them after the RAPIDS 24.06 (June) release. We plan to complete the migration by RAPIDS 24.10 (October) release and they will be removed from RAFT altogether in the 24.12 (December) release.

Bitmap#

#include <raft/core/bitmap.cuh>

namespace raft::core

template<typename bitmap_t = uint32_t, typename index_t = uint32_t>
struct bitmap_view : public raft::core::bitset_view<uint32_t, uint32_t>#
#include <bitmap.hpp>

View of a RAFT Bitmap.

This lightweight structure which represents and manipulates a two-dimensional bitmap matrix view with row major order. This class provides functionality for handling a matrix where each element is represented as a bit in a bitmap.

Template Parameters:
  • bitmap_t – Underlying type of the bitmap array. Default is uint32_t.

  • index_t – Indexing type used. Default is uint32_t.

Public Functions

inline _RAFT_HOST_DEVICE bitmap_view(bitmap_t *bitmap_ptr, index_t rows, index_t cols)#

Create a bitmap view from a device raw pointer.

Parameters:
  • bitmap_ptr – Device raw pointer

  • rows – Number of row in the matrix.

  • cols – Number of col in the matrix.

inline _RAFT_HOST_DEVICE bitmap_view(raft::device_vector_view<bitmap_t, index_t> bitmap_span, index_t rows, index_t cols)#

Create a bitmap view from a device vector view of the bitset.

Parameters:
  • bitmap_span – Device vector view of the bitmap

  • rows – Number of row in the matrix.

  • cols – Number of col in the matrix.

inline _RAFT_HOST_DEVICE bool test (const index_t row, const index_t col) const

Device function to test if a given row and col are set in the bitmap.

Parameters:
  • row – Row index of the bit to test

  • col – Col index of the bit to test

Returns:

bool True if index has not been unset in the bitset

inline _RAFT_HOST_DEVICE void set (const index_t row, const index_t col, bool new_value) const

Device function to set a given row and col to set_value in the bitset.

Parameters:
  • row – Row index of the bit to set

  • col – Col index of the bit to set

  • new_value – Value to set the bit to (true or false)

inline _RAFT_HOST_DEVICE index_t get_n_rows () const

Get the total number of rows.

Returns:

index_t The total number of rows

inline _RAFT_HOST_DEVICE index_t get_n_cols () const

Get the total number of columns.

Returns:

index_t The total number of columns