Points Device

template<std::size_t Ndim, concepts::device TDev = clue::Device>
class PointsDevice : public internal::points_interface<PointsDevice<Ndim, clue::Device>>

The PointsDevice class is a data structure that manages points on a device. It provides methods to allocate, access, and manipulate points in device memory.

Template Parameters:
std::size_t Ndim

The number of dimensions of the points to manage

concepts::device TDev = clue::Device

The device type to use for the allocation. Defaults to clue::Device.

Public Functions

template<concepts::queue TQueue>
PointsDevice(TQueue &queue, int32_t n_points)

Construct a PointsDevice object.

Parameters:
TQueue &queue

The queue to use for the device operations

int32_t n_points

The number of points to allocate

template<concepts::queue TQueue>
PointsDevice(TQueue &queue, int32_t n_points, std::span<std::byte> buffer)

Construct a PointsDevice object with a pre-allocated buffer.

Parameters:
TQueue &queue

The queue to use for the device operations

int32_t n_points

The number of points to allocate

std::span<std::byte> buffer

The buffer to use for the points

template<concepts::queue TQueue>
PointsDevice(TQueue &queue, int32_t n_points, std::span<float> input, std::span<int> output)

Constructs a container for the points allocated on the device using interleaved data.

Note

The input buffer must contain the coordinates and weights in an SoA format

Parameters:
TQueue &queue

The queue to use for memory allocation

int32_t n_points

The number of points

input_buffer

The pre-allocated buffer containing interleaved coordinates and weights

output_buffer

The pre-allocated buffer to store the cluster indexes

template<concepts::queue TQueue>
PointsDevice(TQueue &queue, int32_t n_points, std::span<float> coordinates, std::span<float> weights, std::span<int> output)

Constructs a container for the points allocated on the device using separate coordinate and weight buffers.

Note

The coordinates buffer must have a size of n_points * Ndim

Parameters:
TQueue &queue

The queue to use for memory allocation

int32_t n_points

The number of points

std::span<float> coordinates

The pre-allocated buffer containing the coordinates

std::span<float> weights

The pre-allocated buffer containing the weights

std::span<int> output

The pre-allocated buffer to store the cluster indexes

template<concepts::queue TQueue>
PointsDevice(TQueue &queue, int32_t n_points, float *input, int *output)

Constructs a container for the points allocated on the device using interleaved data.

Note

The input buffer must contain the coordinates and weights in an SoA format

Parameters:
TQueue &queue

The queue to use for memory allocation

int32_t n_points

The number of points

input_buffer

The pre-allocated buffer containing interleaved coordinates and weights

output_buffer

The pre-allocated buffer to store the cluster indexes

template<concepts::queue TQueue>
PointsDevice(TQueue &queue, int32_t n_points, float *coordinates, float *weights, int *output)

Constructs a container for the points allocated on the device using separate coordinate and weight buffers.

Note

The coordinates buffer must have a size of n_points * Ndim

Parameters:
TQueue &queue

The queue to use for memory allocation

int32_t n_points

The number of points

float *coordinates

The pre-allocated buffer containing the coordinates

float *weights

The pre-allocated buffer containing the weights

int *output

The pre-allocated buffer to store the cluster indexes

template<concepts::queue TQueue, concepts::pointer... TBuffers>
PointsDevice(TQueue &queue, int32_t n_points, TBuffers... buffers)

Construct a PointsDevice object with a pre-allocated buffer.

Parameters:
TQueue &queue

The queue to use for the device operations

int32_t n_points

The number of points to allocate

TBuffers... buffers

The buffers to use for the points

PointsDevice(const PointsDevice&) = delete
PointsDevice &operator=(const PointsDevice&) = delete
PointsDevice(PointsDevice&&) = default
PointsDevice &operator=(PointsDevice&&) = default
~PointsDevice() = default
ALPAKA_FN_HOST int32_t size() const

Returns the number of points.

Returns:

The number of points

ALPAKA_FN_HOST auto coords(size_t dim) const

Returns the coordinates of the points for a specific dimension as a const span.

Parameters:
size_t dim

The dimension for which to get the coordinates

Returns:

A const span of the coordinates for the specified dimension

ALPAKA_FN_HOST auto coords(size_t dim)

Returns the coordinates of the points for a specific dimension as a span.

Parameters:
size_t dim

The dimension for which to get the coordinates

Returns:

A span of the coordinates for the specified dimension

ALPAKA_FN_HOST auto weights() const

Returns the weights of the points as a const span.

Returns:

A const span of the weights of the points

ALPAKA_FN_HOST auto weights()

Returns the weights of the points as a span.

Returns:

A span of the weights of the points

ALPAKA_FN_HOST auto clusterIndexes() const

Returns the cluster indexes of the points as a const span.

Returns:

A const span of the cluster indexes of the points

ALPAKA_FN_HOST auto clusterIndexes()

Returns the cluster indexes of the points as a span.

Returns:

A span of the cluster indexes of the points

ALPAKA_FN_HOST auto clustered() const

Indicates whether the points have been clustered.

Returns:

True if the points have been clustered, false otherwise

ALPAKA_FN_HOST const auto &view() const

Returns the view of the points.

Returns:

A const reference to the PointsView structure containing the points data

ALPAKA_FN_HOST auto &view()

Returns the view of the points.

Returns:

A reference to the PointsView structure containing the points data

ALPAKA_FN_HOST auto rho() const
ALPAKA_FN_HOST auto rho()
ALPAKA_FN_HOST auto delta() const
ALPAKA_FN_HOST auto delta()
ALPAKA_FN_HOST auto nearestHigher() const
ALPAKA_FN_HOST auto nearestHigher()
ALPAKA_FN_HOST auto isSeed() const
ALPAKA_FN_HOST auto isSeed()
ALPAKA_FN_HOST const auto &n_clusters()

Teturns the cluster properties of the points.

Note

This value is lazily evaluated and cached upon the first call

Returns:

The number of clusters reconstructed

Friends

friend struct internal::points_interface< PointsDevice< Ndim, TDev > >