STORMM Source Documentation
Loading...
Searching...
No Matches
static_mask_synthesis.h
1// -*-c++-*-
2#ifndef STORMM_STATIC_MASK_SYNTHESIS_H
3#define STORMM_STATIC_MASK_SYNTHESIS_H
4
5#include "copyright.h"
6#include "Accelerator/hybrid.h"
7#include "Potential/static_exclusionmask.h"
8#include "Topology/atomgraph.h"
9
10namespace stormm {
11namespace synthesis {
12
13using card::Hybrid;
14using card::HybridTargetLevel;
15using energy::StaticExclusionMask;
16using topology::AtomGraph;
17
21
24 SeMaskSynthesisReader(int nsys_in, const int* atom_counts_in, const int* atom_offsets_in,
25 int nsupertile_in, int ntile_in, const int* supertile_map_idx_in,
26 const int* supertile_map_bounds_in, const int* tile_map_idx_in,
27 const uint* mask_data_in);
28
32 SeMaskSynthesisReader(const SeMaskSynthesisReader &original) = default;
33 SeMaskSynthesisReader(SeMaskSynthesisReader &&original) = default;
35
36 const int nsys;
37 const int* atom_counts;
38 const int* atom_offsets;
40 const int nsupertile;
41 const int ntile;
42 const int* supertile_map_idx;
46 const int* tile_map_idx;
47 const uint* mask_data;
48};
49
55public:
56
76
77 StaticExclusionMaskSynthesis(const std::vector<StaticExclusionMask*> &base_masks,
78 const std::vector<int> &topology_indices);
79
80 StaticExclusionMaskSynthesis(const std::vector<StaticExclusionMask> &base_masks,
81 const std::vector<int> &topology_indices);
82
83 StaticExclusionMaskSynthesis(const std::vector<AtomGraph*> &base_toplogies,
84 const std::vector<int> &topology_indices);
86
96 StaticExclusionMaskSynthesis& operator=(const StaticExclusionMaskSynthesis &original) = default;
97 StaticExclusionMaskSynthesis& operator=(StaticExclusionMaskSynthesis &&original) = default;
99
101 int getSystemCount() const;
102
106 int getAtomCount(int index = 0) const;
107
111 int getAtomOffset(int index = 0) const;
112
119 bool testExclusion(int system_index, int atom_i, int atom_j) const;
120
122 SeMaskSynthesisReader data(HybridTargetLevel tier = HybridTargetLevel::HOST) const;
123
124#ifdef STORMM_USE_HPC
126 void upload();
127
129 void download();
130#endif
131
132private:
133 int system_count;
134 Hybrid<int> atom_counts;
140 Hybrid<int> atom_offsets;
144 int unique_supertile_count;
147 int unique_tile_count;
148 Hybrid<int> supertile_map_indices;
152 Hybrid<int> supertile_map_bounds;
163 Hybrid<int> tile_map_indices;
166 Hybrid<uint> all_masks;
170
177 void build(const std::vector<StaticExclusionMask*> &base_masks,
178 const std::vector<int> &topology_indices);
179};
180
181} // namespace synthesis
182} // namespace stormm
183
184#endif
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
StaticExclusionMaskSynthesis()
The constructor requires a list of pre-computed StaticExclusionMask objects, each of which will conta...
Definition static_mask_synthesis.cpp:30
StaticExclusionMaskSynthesis(const StaticExclusionMaskSynthesis &original)=default
With no const members or pointers to repair (including POINTER-kind Hybrid) objects,...
SeMaskSynthesisReader data(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the abstract for this static exclusion mask synthesis.
Definition static_mask_synthesis.cpp:215
bool testExclusion(int system_index, int atom_i, int atom_j) const
Obtain from the mask whether a combination of two atoms in a particular system constitutes an exclusi...
Definition static_mask_synthesis.cpp:197
int getAtomOffset(int index=0) const
Get the starting position of atoms in one of the systems described by the mask.
Definition static_mask_synthesis.cpp:192
StaticExclusionMaskSynthesis()
The constructor requires a list of pre-computed StaticExclusionMask objects, each of which will conta...
Definition static_mask_synthesis.cpp:30
int getAtomCount(int index=0) const
Get the number of atoms in one of the systems described by the mask.
Definition static_mask_synthesis.cpp:187
int getSystemCount() const
Get the number of systems covered by this object.
Definition static_mask_synthesis.cpp:182
SeMaskSynthesisReader(int nsys_in, const int *atom_counts_in, const int *atom_offsets_in, int nsupertile_in, int ntile_in, const int *supertile_map_idx_in, const int *supertile_map_bounds_in, const int *tile_map_idx_in, const uint *mask_data_in)
The constructor takes the object's constants and data pointers on either the CPU or HPC resources.
Definition static_mask_synthesis.cpp:17
The read-only abstract for a static exclusion mask compilation. This provides access in a similar for...
Definition static_mask_synthesis.h:20
SeMaskSynthesisReader(const SeMaskSynthesisReader &original)=default
Like other abstracts, this one is compatible with the default copy and move constructors,...
const int nsys
The number of systems covered by this object.
Definition static_mask_synthesis.h:36
const int * tile_map_idx
Tile maps for all unique supertiles.
Definition static_mask_synthesis.h:46
const uint * mask_data
Mask data for all unique tiles.
Definition static_mask_synthesis.h:47
const int * atom_counts
Counts of atoms in all systems.
Definition static_mask_synthesis.h:37
const int * atom_offsets
Definition static_mask_synthesis.h:38
const int nsupertile
Number of unique supertiles stored by the mask.
Definition static_mask_synthesis.h:40
const int * supertile_map_idx
Definition static_mask_synthesis.h:42
SeMaskSynthesisReader(int nsys_in, const int *atom_counts_in, const int *atom_offsets_in, int nsupertile_in, int ntile_in, const int *supertile_map_idx_in, const int *supertile_map_bounds_in, const int *tile_map_idx_in, const uint *mask_data_in)
The constructor takes the object's constants and data pointers on either the CPU or HPC resources.
Definition static_mask_synthesis.cpp:17
const int ntile
Number of unique tiles stored by the mask.
Definition static_mask_synthesis.h:41
const int * supertile_map_bounds
Definition static_mask_synthesis.h:44