Loading...
Searching...
No Matches
gpu_residency.hpp
Go to the documentation of this file.
1#ifndef SEAMS_GPU_RESIDENCY_H_
2#define SEAMS_GPU_RESIDENCY_H_
3
4#include <cstddef>
5#include <string>
6
16
17namespace gpu {
18
19struct DeviceInfo {
20 bool available = false;
21 std::string name;
22 int computeMajor = 0;
23 int computeMinor = 0;
24 std::size_t totalBytes = 0;
25 std::size_t freeBytes = 0;
26 std::string reason;
27};
28
29struct Footprint {
30 int nAtoms = 0;
31 int nFrames = 0;
32 int kMax = 16;
34 std::size_t xyzBytes = 0;
35 std::size_t nlistBytes = 0;
36 std::size_t ringsBytes = 0;
37 std::size_t labelBytes = 0;
38 std::size_t totalBytes = 0;
39};
40
41struct Plan {
42 bool resident = false;
43 int frames = 0;
46 std::string reason;
47};
48
50
51Footprint estimateFootprint(int nAtoms, int nFrames, int kMax = 16,
52 int maxSixRingsPerAtom = 16);
53
54int maxResidentFrames(const DeviceInfo &dev, int nAtoms, int kMax = 16,
55 int maxSixRingsPerAtom = 16, double safety = 0.80);
56
57Plan planBatch(int nAtoms, int requestedFrames, int kMax = 16,
58 int maxSixRingsPerAtom = 16, double safety = 0.80);
59
60} // namespace gpu
61
62#endif
Plan planBatch(int nAtoms, int requestedFrames, int kMax=16, int maxSixRingsPerAtom=16, double safety=0.80)
int maxResidentFrames(const DeviceInfo &dev, int nAtoms, int kMax=16, int maxSixRingsPerAtom=16, double safety=0.80)
Footprint estimateFootprint(int nAtoms, int nFrames, int kMax=16, int maxSixRingsPerAtom=16)
DeviceInfo probeDevice()
std::size_t totalBytes
std::string reason
std::size_t freeBytes
std::size_t ringsBytes
std::size_t xyzBytes
std::size_t totalBytes
std::size_t labelBytes
std::size_t nlistBytes
Footprint foot
std::string reason
DeviceInfo device