Points Host¶
-
template<std::size_t Ndim>
class PointsHost : public internal::points_interface<PointsHost<Ndim>>¶ The PointsHost class is a data structure that manages points in host memory. It provides methods to allocate, access, and manipulate points in host memory.
Public Functions¶
-
template<concepts::queue TQueue>
PointsHost(TQueue &queue, int32_t n_points)¶ Constructs a container for the points allocated on the host.
-
template<concepts::queue TQueue>
PointsHost(TQueue &queue, int32_t n_points, std::span<std::byte> buffer)¶ Constructs a container for the points allocated on the host using a pre-allocated buffers.
-
template<concepts::queue TQueue>
PointsHost(TQueue &queue, int32_t n_points, std::span<float> input, std::span<int> output)¶ Constructs a container for the points allocated on the host using interleaved data.
Note
The input buffer must contain the coordinates and weights in an SoA format
-
template<concepts::queue TQueue>
PointsHost(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 host 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, std::ranges::contiguous_range... TBuffers>
PointsHost(TQueue &queue, int32_t n_points, TBuffers&&... buffers)¶ Constructs a container for the points allocated on the host using multiple pre-allocated buffers.
-
template<concepts::queue TQueue>
PointsHost(TQueue &queue, int32_t n_points, float *input, int *output)¶ Constructs a container for the points allocated on the host using interleaved data.
Note
The input buffer must contain the coordinates and weights in an SoA format
-
template<concepts::queue TQueue>
PointsHost(TQueue &queue, int32_t n_points, float *coordinates, float *weights, int *output)¶ Constructs a container for the points allocated on the host using separate coordinate and weight buffers.
Note
The coordinates buffer must have a size of n_points * Ndim
- Parameters:¶
-
template<concepts::queue TQueue, concepts::pointer... TBuffers>
PointsHost(TQueue &queue, int32_t n_points, TBuffers... buffers)¶ Constructs a container for the points allocated on the host using multiple pre-allocated buffers.
-
PointsHost(const PointsHost&) = delete¶
-
PointsHost &operator=(const PointsHost&) = delete¶
-
PointsHost(PointsHost&&) = default¶
-
PointsHost &operator=(PointsHost&&) = default¶
-
~PointsHost() = 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
-
ALPAKA_FN_HOST auto &view()¶
Returns the view of the points.
- Returns:¶
A reference to the PointsView structure containing the points data
-
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
-
const auto &clusters()¶
Returns the associator mapping clusters to their associated points.
Note
This object is lazily evaluated and cached upon the first call
- Returns:¶
An host_associator mapping clusters to points
-
const auto &cluster_sizes()¶
Returns a vector containing the sizes of each cluster.
Note
This vector is lazily evaluated and cached upon the first call
- Returns:¶
A vector of containing the sizes of each cluster
-
const auto &cluster_properties()¶
Returns the ClusterProperties object containing the properties of the clusters.
Note
This object is lazily evaluated and cached upon the first call
- Returns:¶
The ClusterProperties object
Friends¶
- friend struct internal::points_interface< PointsHost< Ndim > >
-
template<concepts::queue TQueue>