seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
tum_offload.hpp
Go to the documentation of this file.
1//-----------------------------------------------------------------------------------
2// d-SEAMS - Deferred Structural Elucidation Analysis for Molecular Simulations
3//
4// Copyright (c) 2018--present d-SEAMS core team
5//
6// SPDX-License-Identifier: MIT
7//-----------------------------------------------------------------------------------
8
9#ifndef SEAMS_TUM_OFFLOAD_H_
10#define SEAMS_TUM_OFFLOAD_H_
11
12#include <vector>
13
33
34namespace tum {
35
36struct CageCounts {
37 int nSix = 0;
38 int nHcRings = 0;
39 int nDdcRings = 0;
40 int nHcAtoms = 0;
41 int nDdcAtoms = 0;
42 int retries = 0; // passes discarded after a buffer overflowed
43 bool hostFallback = false; // a row passed kRowCap; hostCageCounts ran
44 bool usedDevice = false;
45 std::vector<int> atomSix; // six-rings through each atom
46 std::vector<int> atomHc;
47 std::vector<int> atomDdc;
48};
49
52 int rowCap = 32; // ring ids per atom row, at most tum::device::kRowCap
53 int ringCap = 0; // rings; 0 is 16 per atom
54 int pairCap = 0; // basal pairs; 0 is 8 per ring of ringCap
55 // Run the OpenMP target branch when no device is present; it then
56 // executes on the initial device. Has no effect without offload.
57 bool forceTarget = false;
58};
59
61[[nodiscard]] bool preferOffload();
62
66 const std::vector<std::vector<int>> &nList);
67
71 const std::vector<std::vector<int>> &nList);
72
74[[nodiscard]] CageCounts
75specializedCageCounts(const std::vector<std::vector<int>> &nList,
76 const SpecializedCaps &caps);
77
79[[nodiscard]] CageCounts cageCounts(const std::vector<std::vector<int>> &nList);
80
81} // namespace tum
82
83#endif
CageCounts specializedCageCounts(const std::vector< std::vector< int > > &nList)
Hop-bound six-ring enumerator plus affiliation predicates.
CageCounts hostCageCounts(const std::vector< std::vector< int > > &nList)
Host Franzblau six-rings plus cageAffiliation on an index nList (leading self entry,...
CageCounts cageCounts(const std::vector< std::vector< int > > &nList)
preferOffload() selects specializedCageCounts, otherwise hostCageCounts.
bool preferOffload()
True when SEAMS_OFFLOAD is set and is not "0".
std::vector< int > atomHc
std::vector< int > atomSix
std::vector< int > atomDdc
Initial buffer sizes of the hop-bound path.