#ifndef LINKCELL_GPU_HPP
#define LINKCELL_GPU_HPP
#include "linkcell.hpp"
#include <cstddef>
namespace linkcell {
namespace gpu {
#if defined(LINKCELL_HAS_GPULITE)
bool available();
class Workspace {
public:
Workspace();
~Workspace();
Workspace(Workspace &&) noexcept;
Workspace &operator=(Workspace &&) noexcept;
Workspace(const Workspace &) = delete;
Workspace &operator=(const Workspace &) = delete;
void knearest_into(const double *xyz, std::size_t n, const Cell &cell,
std::size_t k, int *out, std::size_t out_len,
const int *mask = nullptr, double cell_hint = 0.0,
double *out_d2 = nullptr);
void knearest_into_many(const double *xyz, std::size_t n,
std::size_t nFrames, const Cell &cell, std::size_t k,
int *out, std::size_t out_len,
const int *mask = nullptr, double cell_hint = 0.0,
bool wait = true, const double *frameBox = nullptr,
double *out_d2 = nullptr);
void knearest_into_many_dcell(const double *xyz, std::size_t n,
std::size_t nFrames, const double *cell,
int cell_n, std::size_t k, int *out,
std::size_t out_len, const int *mask = nullptr,
double cell_hint = 0.0, bool wait = true,
double *out_d2 = nullptr);
void *queue();
void wait();
private:
struct Impl;
Impl *impl_;
void launchWalk(const double *xyz, std::size_t n, std::size_t nFrames,
std::size_t k, int *out, const int *mask, bool wait,
double *out_d2, int nx, int ny, int nz, int nC,
int maxReach);
};
#else
inline bool available() { return false; }
#endif
} }
#endif