SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parallel.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 1999-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef PARALLEL_H__
12 #define PARALLEL_H__
13 
14 #include <shogun/lib/config.h>
15 #include <shogun/lib/common.h>
16 #include <shogun/io/SGIO.h>
17 
18 namespace shogun
19 {
20 class RefCount;
27 class Parallel
28 {
29 public:
31  Parallel();
32 
34  Parallel(const Parallel& orig);
35 
37  virtual ~Parallel();
38 
42  int32_t get_num_cpus() const;
43 
47  void set_num_threads(int32_t n);
48 
52  int32_t get_num_threads() const;
53 
57  int32_t ref();
58 
62  int32_t ref_count() const;
63 
67  int32_t unref();
68 
69 private:
71  RefCount* m_refcount;
72 
74  int32_t num_threads;
75 };
76 }
77 #endif

SHOGUN Machine Learning Toolbox - Documentation