#ifndef LINKCELL_GPU_H
#define LINKCELL_GPU_H
#pragma once
#include "linkcell.h"
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct lc_gpu_workspace lc_gpu_workspace;
int lc_gpu_available(void);
const char *lc_gpu_last_error(void);
lc_gpu_workspace *lc_gpu_workspace_new(void);
void lc_gpu_workspace_free(lc_gpu_workspace *ws);
int lc_gpu_knearest(lc_gpu_workspace *ws, const double *xyz, size_t n,
const struct lc_cell *simbox, size_t k, const int *mask,
double cell_hint, int *out_nn, double *out_d2);
int lc_gpu_knearest_many(lc_gpu_workspace *ws, const double *xyz, size_t n,
size_t n_frames, const struct lc_cell *simbox,
size_t k, const int *mask, double cell_hint,
int *out_nn, double *out_d2, int wait);
int lc_gpu_knearest_many_dcell(lc_gpu_workspace *ws, const double *xyz,
size_t n, size_t n_frames, const double *cell,
int cell_n, size_t k, const int *mask,
double cell_hint, int *out_nn, double *out_d2,
int wait);
void *lc_gpu_queue(lc_gpu_workspace *ws);
void lc_gpu_wait(lc_gpu_workspace *ws);
int lc_gpu_alloc(void **ptr, size_t bytes);
void lc_gpu_free(void *ptr);
int lc_gpu_fill_i32(void *ptr, int value, size_t n);
int lc_gpu_memcpy(void *dst, const void *src, size_t bytes, int kind);
#ifdef __cplusplus
}
#endif
#endif