| 89 | class MemSampler { |
| 90 | public: |
| 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(); |
nothing calls this directly
no test coverage detected