2020-08-18 14:27:28 +02:00
|
|
|
/*
|
2022-09-05 10:39:42 +02:00
|
|
|
* Copyright (C) 2022 NHR@FAU, University Erlangen-Nuremberg.
|
|
|
|
* All rights reserved. This file is part of MD-Bench.
|
|
|
|
* Use of this source code is governed by a LGPL-3.0
|
|
|
|
* license that can be found in the LICENSE file.
|
2020-08-18 14:27:28 +02:00
|
|
|
*/
|
|
|
|
#include <atom.h>
|
|
|
|
#include <parameter.h>
|
|
|
|
|
|
|
|
#ifndef __NEIGHBOR_H_
|
|
|
|
#define __NEIGHBOR_H_
|
2022-08-12 17:28:06 +02:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int *neighbors;
|
|
|
|
int *numneigh;
|
|
|
|
} DeviceNeighbor;
|
|
|
|
|
2020-08-18 14:27:28 +02:00
|
|
|
typedef struct {
|
|
|
|
int every;
|
|
|
|
int ncalls;
|
|
|
|
int maxneighs;
|
2022-03-18 01:28:11 +01:00
|
|
|
int half_neigh;
|
2022-08-12 17:28:06 +02:00
|
|
|
int *neighbors;
|
|
|
|
int *numneigh;
|
|
|
|
|
|
|
|
// Device data
|
|
|
|
DeviceNeighbor d_neighbor;
|
2020-08-18 14:27:28 +02:00
|
|
|
} Neighbor;
|
|
|
|
|
2022-08-09 18:53:53 +02:00
|
|
|
typedef struct {
|
|
|
|
MD_FLOAT xprd; MD_FLOAT yprd; MD_FLOAT zprd;
|
|
|
|
MD_FLOAT bininvx; MD_FLOAT bininvy; MD_FLOAT bininvz;
|
|
|
|
int mbinxlo; int mbinylo; int mbinzlo;
|
|
|
|
int nbinx; int nbiny; int nbinz;
|
|
|
|
int mbinx; int mbiny; int mbinz;
|
|
|
|
} Neighbor_params;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int* bincount;
|
|
|
|
int* bins;
|
|
|
|
int mbins;
|
|
|
|
int atoms_per_bin;
|
|
|
|
} Binning;
|
|
|
|
|
2020-08-18 14:27:28 +02:00
|
|
|
extern void initNeighbor(Neighbor*, Parameter*);
|
2021-11-30 01:33:55 +01:00
|
|
|
extern void setupNeighbor(Parameter*);
|
2020-08-18 14:27:28 +02:00
|
|
|
extern void binatoms(Atom*);
|
2022-08-12 17:28:06 +02:00
|
|
|
extern void buildNeighbor_cpu(Atom*, Neighbor*);
|
2021-11-03 00:57:24 +01:00
|
|
|
extern void sortAtom(Atom*);
|
2022-08-09 18:53:53 +02:00
|
|
|
|
|
|
|
#ifdef CUDA_TARGET
|
2022-08-12 17:28:06 +02:00
|
|
|
extern void buildNeighbor_cuda(Atom*, Neighbor*);
|
2022-08-09 18:53:53 +02:00
|
|
|
#endif
|
|
|
|
|
2020-08-18 14:27:28 +02:00
|
|
|
#endif
|