7#include "CLUEstering/data_structures/internal/PointsCommon.hpp"
8#include "CLUEstering/internal/alpaka/memory.hpp"
13#include <alpaka/alpaka.hpp>
21 template <u
int8_t Ndim>
22 class PointsHost :
public internal::points_interface<PointsHost<Ndim>> {
24 std::optional<host_buffer<std::byte[]>> m_buffer;
30 std::array<float, Ndim> m_coordinates;
35 Point(
const std::array<float, Ndim>& coordinates,
float weight,
int cluster_index);
36 float operator[](
size_t dim)
const;
39 float cluster_index()
const;
42 template <concepts::queue TQueue>
43 PointsHost(TQueue& queue, int32_t n_points);
45 template <concepts::queue TQueue>
46 PointsHost(TQueue& queue, int32_t n_points, std::span<std::byte> buffer);
48 template <concepts::queue TQueue, std::ranges::contiguous_range... TBuffers>
49 requires(
sizeof...(TBuffers) == 2 ||
sizeof...(TBuffers) == 4)
50 PointsHost(TQueue& queue, int32_t n_points, TBuffers&&... buffers);
52 template <concepts::queue TQueue, concepts::contiguous_raw_data... TBuffers>
53 requires(
sizeof...(TBuffers) == 2 ||
sizeof...(TBuffers) == 4)
54 PointsHost(TQueue& queue, int32_t n_points, TBuffers... buffers);
56 PointsHost(
const PointsHost&) =
delete;
57 PointsHost& operator=(
const PointsHost&) =
delete;
58 PointsHost(PointsHost&&) =
default;
59 PointsHost& operator=(PointsHost&&) =
default;
60 ~PointsHost() =
default;
62#ifdef CLUE_BUILD_DOXYGEN
65 ALPAKA_FN_HOST int32_t
size()
const;
75 ALPAKA_FN_HOST
auto coords(
size_t dim)
const;
79 ALPAKA_FN_HOST
auto coords(
size_t dim);
100 ALPAKA_FN_HOST
const auto&
view()
const;
106 Point operator[](std::size_t idx)
const;
109 inline static constexpr uint8_t Ndim_ = Ndim;
111 template <concepts::queue _TQueue, u
int8_t _Ndim, concepts::device _TDev>
112 friend void copyToHost(_TQueue& queue,
113 PointsHost<_Ndim>& h_points,
115 template <concepts::queue _TQueue, u
int8_t _Ndim, concepts::device _TDev>
116 friend void copyToDevice(_TQueue& queue,
118 const PointsHost<_Ndim>& h_points);
119 friend struct internal::points_interface<PointsHost<Ndim>>;
124#include "CLUEstering/data_structures/detail/PointsHost.hpp"
125#include "CLUEstering/data_structures/detail/Point.hpp"
The PointsDevice class is a data structure that manages points on a device. It provides methods to al...
Definition PointsDevice.hpp:25
Definition PointsHost.hpp:29
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 clusterIndexes()
Returns the cluster indexes of the points as a span.
ALPAKA_FN_HOST const auto & view() const
Returns the view of the points.
ALPAKA_FN_HOST auto & view()
Returns the view of the points.
ALPAKA_FN_HOST int32_t size() const
Returns the number of points.
ALPAKA_FN_HOST auto coords()
Returns the coordinates of the points as a span.
ALPAKA_FN_HOST auto isSeed()
Returns the seed status of the points as a span.
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 clusterIndexes() const
Returns the cluster indexes of the points as a const span.
ALPAKA_FN_HOST auto isSeed() const
Returns the seed status of the points as a const span.
ALPAKA_FN_HOST auto coords() const
Returns the coordinates of the points as a const span.
ALPAKA_FN_HOST auto weights()
Returns the weights of the points as a span.
ALPAKA_FN_HOST auto weights() const
Returns the weights of the points as a const span.