MCPcopy Create free account
hub / github.com/Niko1221/Strata / MemSampler

Method MemSampler

engine/src/image/qi21_image_main.cpp:91–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89class MemSampler {
90public:
91 MemSampler() {
92 size_t f = 0, t = 0;
93 cudaMemGetInfo(&f, &t);
94 base_ = t - f;
95 total_ = t;
96 stage_max_ = base_;
97 th_ = std::thread([this] {
98 while (!stop_) {
99 sample();
100 std::this_thread::sleep_for(std::chrono::milliseconds(2));
101 }
102 });
103 }
104 ~MemSampler() {
105 stop_ = true;
106 th_.join();

Callers

nothing calls this directly

Calls 2

cudaMemGetInfoFunction · 0.50
sampleFunction · 0.50

Tested by

no test coverage detected