Points Device¶
-
template<std::size_t Ndim, std::floating_point TData = float, concepts::device TDev = clue::Device>
class PointsDevice : public internal::points_interface<PointsDevice<Ndim, float, 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:¶
Public Functions¶
-
template<concepts::queue TQueue>
PointsDevice(TQueue &queue, std::int32_t n_points)¶ Construct a PointsDevice object.
-
template<concepts::queue TQueue>
PointsDevice(TQueue &queue, std::int32_t n_points, std::span<std::byte> buffer)¶ Construct a PointsDevice object with a pre-allocated buffer.
-
template<concepts::queue TQueue>
PointsDevice(TQueue &queue, std::int32_t n_points, std::span<element_type> 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
-
template<concepts::queue TQueue>
PointsDevice(TQueue &queue, std::int32_t n_points, std::span<element_type> coordinates, std::span<element_type> 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
- std::int32_t n_points¶
The number of points
- std::span<element_type> coordinates¶
The pre-allocated buffer containing the coordinates
- std::span<element_type> 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, std::int32_t n_points, element_type *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
-
template<concepts::queue TQueue>
PointsDevice(TQueue &queue, std::int32_t n_points, element_type *coordinates, element_type *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
- std::int32_t n_points¶
The number of points
- element_type *coordinates¶
The pre-allocated buffer containing the coordinates
- element_type *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, std::int32_t n_points, TBuffers... buffers)¶ Construct a PointsDevice object with a pre-allocated buffer.
-
PointsDevice(const PointsDevice&) = delete¶
-
PointsDevice &operator=(const PointsDevice&) = delete¶
-
PointsDevice(PointsDevice&&) = default¶
-
PointsDevice &operator=(PointsDevice&&) = default¶
-
~PointsDevice() = default¶
-
ALPAKA_FN_HOST auto coords(size_t dim) const¶
Returns the coordinates of the points for a specific dimension as a const span.
-
ALPAKA_FN_HOST auto coords(size_t dim)¶
Returns the coordinates of the points for a specific dimension as a span.
-
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