ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
gpu_neighbor_list.h
Go to the documentation of this file.
1#ifndef SOURCE_CELL_MODULE_NEIGHLIST_GPU_NEIGHBOR_LIST_H
2#define SOURCE_CELL_MODULE_NEIGHLIST_GPU_NEIGHBOR_LIST_H
3
4#include <string>
5#include <vector>
6
7namespace ModuleNeighList
8{
9
11{
12 public:
13 GPU_NeighborList() = default;
15
18
19 bool build(int nall,
20 double cutoff,
21 const std::vector<double>& position,
22 std::vector<int>& neighbor_count,
23 std::vector<int>& neighbor_indices,
24 int& max_neighbors,
25 std::string& error) const;
26
27 bool filter(int nall,
28 double cutoff,
29 const std::vector<double>& position,
30 const std::vector<int>& candidate_count,
31 const std::vector<int>& candidate_indices,
32 int candidate_max_neighbors,
33 std::vector<int>& neighbor_count,
34 std::vector<int>& neighbor_indices,
35 int& max_neighbors,
36 std::string& error) const;
37
38 bool build_device(int nall,
39 double cutoff,
40 const std::vector<double>& position,
41 int& max_neighbors,
42 std::string& error);
43
44 bool filter_device(int nall,
45 double cutoff,
46 const std::vector<double>& position,
47 int candidate_max_neighbors,
48 int& max_neighbors,
49 std::string& error);
50
52
53 bool upload(int nall,
54 int max_neighbors,
55 const std::vector<int>& neighbor_count,
56 const std::vector<int>& neighbor_indices,
57 std::string& error);
58
59 const void* device_neighbor_count() const;
60 const void* device_neighbor_indices() const;
61 int device_nall() const;
62 int device_max_neighbors() const;
63
64 private:
65 void* candidate_device_count_ = nullptr;
69 void* filtered_device_count_ = nullptr;
70 void* filtered_device_indices_ = nullptr;
73 void* device_neighbor_count_ = nullptr;
74 void* device_neighbor_indices_ = nullptr;
75 int device_nall_ = 0;
77};
78
79} // namespace ModuleNeighList
80
81#endif
GPU_NeighborList()=default
GPU_NeighborList & operator=(const GPU_NeighborList &)=delete
int device_nall() const
Definition gpu_neighbor_list.cpp:245
int filtered_device_nall_
Definition gpu_neighbor_list.h:71
bool filter_device(int nall, double cutoff, const std::vector< double > &position, int candidate_max_neighbors, int &max_neighbors, std::string &error)
Definition gpu_neighbor_list.cpp:127
void * device_neighbor_count_
Definition gpu_neighbor_list.h:73
bool upload(int nall, int max_neighbors, const std::vector< int > &neighbor_count, const std::vector< int > &neighbor_indices, std::string &error)
Definition gpu_neighbor_list.cpp:192
void * device_neighbor_indices_
Definition gpu_neighbor_list.h:74
void * filtered_device_count_
Definition gpu_neighbor_list.h:69
GPU_NeighborList(const GPU_NeighborList &)=delete
int candidate_device_nall_
Definition gpu_neighbor_list.h:67
bool build(int nall, double cutoff, const std::vector< double > &position, std::vector< int > &neighbor_count, std::vector< int > &neighbor_indices, int &max_neighbors, std::string &error) const
Definition gpu_neighbor_list.cpp:255
void * filtered_device_indices_
Definition gpu_neighbor_list.h:70
void * candidate_device_indices_
Definition gpu_neighbor_list.h:66
int device_max_neighbors() const
Definition gpu_neighbor_list.cpp:250
int device_nall_
Definition gpu_neighbor_list.h:75
int device_max_neighbors_
Definition gpu_neighbor_list.h:76
~GPU_NeighborList()
Definition gpu_neighbor_list.cpp:64
int candidate_device_max_neighbors_
Definition gpu_neighbor_list.h:68
void * candidate_device_count_
Definition gpu_neighbor_list.h:65
bool filter(int nall, double cutoff, const std::vector< double > &position, const std::vector< int > &candidate_count, const std::vector< int > &candidate_indices, int candidate_max_neighbors, std::vector< int > &neighbor_count, std::vector< int > &neighbor_indices, int &max_neighbors, std::string &error) const
Definition gpu_neighbor_list.cpp:315
int filtered_device_max_neighbors_
Definition gpu_neighbor_list.h:72
const void * device_neighbor_count() const
Definition gpu_neighbor_list.cpp:235
const void * device_neighbor_indices() const
Definition gpu_neighbor_list.cpp:240
void use_candidate_device()
Definition gpu_neighbor_list.cpp:179
bool build_device(int nall, double cutoff, const std::vector< double > &position, int &max_neighbors, std::string &error)
Definition gpu_neighbor_list.cpp:78
Definition gpu_neighbor_list.cpp:62