AliceVision
Photogrammetric Computer Vision Framework
hardwareContext.hpp
1 // This file is part of the AliceVision project.
2 // Copyright (c) 2016 AliceVision contributors.
3 // This Source Code Form is subject to the terms of the Mozilla Public License,
4 // v. 2.0. If a copy of the MPL was not distributed with this file,
5 // You can obtain one at https://mozilla.org/MPL/2.0/.
6 
7 #pragma once
8 
9 #include "Logger.hpp"
10 #include "Timer.hpp"
11 
12 namespace aliceVision {
13 
15 {
16  public:
17  void displayHardware();
18 
19  size_t getUserMaxMemoryAvailable() const { return _maxUserMemoryAvailable; }
20 
21  void setUserMaxMemoryAvailable(size_t val) { _maxUserMemoryAvailable = val; }
22 
23  unsigned int getUserMaxCoresAvailable() const { return _maxUserCoresAvailable; }
24 
25  void setUserMaxCoresAvailable(unsigned int val) { _maxUserCoresAvailable = val; }
26 
27  void setUserCoresLimit(unsigned int coresLimit) { _limitUserCores = coresLimit; }
28 
29  unsigned int getMaxThreads() const;
30 
35  size_t getMaxMemory() const;
36 
37  private:
43  size_t _maxUserMemoryAvailable = std::numeric_limits<size_t>::max();
44 
50  unsigned int _maxUserCoresAvailable = std::numeric_limits<unsigned int>::max();
51 
56  unsigned int _limitUserCores = std::numeric_limits<unsigned int>::max();
57 };
58 
59 } // namespace aliceVision
aliceVision::HardwareContext
Definition: hardwareContext.hpp:14
aliceVision
Definition: checkerDetector.cpp:32
aliceVision::HardwareContext::getMaxMemory
size_t getMaxMemory() const
compute the maximum memory available
Definition: hardwareContext.cpp:54