7#include "CLUEstering/core/detail/CLUEAlpakaKernels.hpp"
8#include "CLUEstering/core/detail/defines.hpp"
11#include "CLUEstering/data_structures/Tiles.hpp"
12#include "CLUEstering/data_structures/internal/Followers.hpp"
24 template <u
int8_t Ndim>
31 using FollowersDevice = clue::Followers<clue::Device>;
32 using Acc = internal::Acc;
33 inline static constexpr auto reserve = detail::reserve;
40 std::array<uint8_t, Ndim> m_wrappedCoordinates;
42 std::optional<TilesDevice> d_tiles;
43 std::optional<clue::device_buffer<Device, VecArray<int32_t, reserve>>> d_seeds;
44 std::optional<FollowersDevice> d_followers;
45 std::optional<PointsDevice> d_points;
48 VecArray<int32_t, reserve>* m_seeds;
49 FollowersView* m_followers;
51 void init_device(Queue& queue);
52 void init_device(Queue& queue, TilesDevice* tile_buffer);
54 void setupTiles(Queue& queue,
const PointsHost& h_points);
55 void setupTiles(Queue& queue,
const PointsDevice& d_points);
57 void setupFollowers(Queue& queue, int32_t n_points);
59 void setupPoints(
const PointsHost& h_points, PointsDevice& dev_points, Queue& queue);
61 void setup(Queue& queue,
const PointsHost& h_points, PointsDevice& dev_points) {
62 setupTiles(queue, h_points);
63 setupFollowers(queue, h_points.size());
64 setupPoints(h_points, dev_points, queue);
67 void calculate_tile_size(CoordinateExtremes* min_max,
69 const PointsHost& h_points,
71 void calculate_tile_size(Queue& queue,
72 CoordinateExtremes* min_max,
74 const PointsDevice& dev_points,
77 template <
typename KernelType>
78 void make_clusters_impl(PointsHost& h_points,
79 PointsDevice& dev_points,
80 const KernelType& kernel,
82 std::size_t block_size);
83 template <
typename KernelType>
84 void make_clusters_impl(PointsDevice& dev_points,
85 const KernelType& kernel,
87 std::size_t block_size);
97 Clusterer(
float dc,
float rhoc,
float dm,
float seed_dc = -1.f,
int pPBin = 128);
106 Clusterer(Queue& queue,
float dc,
float rhoc,
float dm,
float seed_dc = -1.f,
int pPBin = 128);
117 TilesDevice* tile_buffer,
121 float seed_dc = -1.f,
130 template <
typename KernelType>
132 const KernelType& kernel,
134 std::size_t block_size);
140 template <
typename KernelType>
141 void make_clusters(PointsHost& h_points,
const KernelType& kernel, std::size_t block_size);
149 template <
typename KernelType>
151 PointsDevice& dev_points,
152 const KernelType& kernel,
154 std::size_t block_size);
161 template <
typename KernelType>
163 PointsDevice& dev_points,
164 const KernelType& kernel,
165 std::size_t block_size);
172 template <
typename KernelType>
174 const KernelType& kernel,
176 std::size_t block_size);
190 template <
typename... TArgs>
197 std::vector<std::vector<int>>
getClusters(
const PointsHost& h_points);
202#include "CLUEstering/core/detail/Clusterer.hpp"
Provides the PointsDevice class for managing points on a device.
Provides the PointsHost class for managing points in host memory.
Clusterer(float dc, float rhoc, float dm, float seed_dc=-1.f, int pPBin=128)
Constuct a Clusterer object.
void make_clusters(PointsDevice &dev_points, const KernelType &kernel, Queue &queue, std::size_t block_size)
Construct the clusters from device points.
void make_clusters(PointsHost &h_points, const KernelType &kernel, Queue &queue, std::size_t block_size)
Construct the clusters from host points.
void setWrappedCoordinates(TArgs... wrappedCoordinates)
Specify which coordinates are periodic.
void make_clusters(PointsHost &h_points, PointsDevice &dev_points, const KernelType &kernel, std::size_t block_size)
Construct the clusters from host and device points.
void make_clusters(PointsHost &h_points, const KernelType &kernel, std::size_t block_size)
Construct the clusters from host points.
void setWrappedCoordinates(std::array< uint8_t, Ndim > &&wrappedCoordinates)
Specify which coordinates are periodic.
std::vector< std::vector< int > > getClusters(const PointsHost &h_points)
Get the clusters from the host points.
Clusterer(Queue &queue, TilesDevice *tile_buffer, float dc, float rhoc, float dm, float seed_dc=-1.f, int pPBin=128)
Constuct a Clusterer object.
Clusterer(Queue &queue, float dc, float rhoc, float dm, float seed_dc=-1.f, int pPBin=128)
Constuct a Clusterer object.
void setWrappedCoordinates(const std::array< uint8_t, Ndim > &wrappedCoordinates)
Specify which coordinates are periodic.
void make_clusters(PointsHost &h_points, PointsDevice &dev_points, const KernelType &kernel, Queue &queue, std::size_t block_size)
Construct the clusters from host and device points.
The PointsDevice class is a data structure that manages points on a device. It provides methods to al...
Definition PointsDevice.hpp:27
The PointsHost class is a data structure that manages points in host memory. It provides methods to a...
Definition PointsHost.hpp:24