BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
parallelization_options.hpp
1 // Copyright (C) 2011-2012 by the BEM++ Authors
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 // THE SOFTWARE.
20 
21 #ifndef fiber_parallelization_options_hpp
22 #define fiber_parallelization_options_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "opencl_options.hpp"
27 
28 namespace Fiber
29 {
30 
33 {
34 public:
35  enum { AUTO = -1 };
36 
39 
43  void disableOpenCl();
45  bool isOpenClEnabled() const;
47  const OpenClOptions& openClOptions() const;
48 
54  void setMaxThreadCount(int maxThreadCount = AUTO);
55 
61  int maxThreadCount() const;
62 
63 private:
64  bool m_openClEnabled;
65  OpenClOptions m_openClOptions;
66  int m_maxThreadCount;
67 };
68 
69 } // namespace Fiber
70 
71 #endif
Parallel operation settings.
Definition: parallelization_options.hpp:32
ParallelizationOptions()
Constructor.
Definition: parallelization_options.cpp:28
void enableOpenCl(const OpenClOptions &openClOptions)
Enable GPU-based calculations (currently broken).
Definition: parallelization_options.cpp:34
void disableOpenCl()
Disable GPU-based calculations.
Definition: parallelization_options.cpp:41
bool isOpenClEnabled() const
Return whether GPU-based calculations are enabled.
Definition: parallelization_options.cpp:47
int maxThreadCount() const
Return the maximum number of thread used during the assembly.
Definition: parallelization_options.cpp:64
Definition: opencl_options.hpp:29
const OpenClOptions & openClOptions() const
Return current settings controlling operation of the GPU.
Definition: parallelization_options.cpp:52
void setMaxThreadCount(int maxThreadCount=AUTO)
Set the maximum number of threads used during the assembly.
Definition: parallelization_options.cpp:56