SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 
16 #include <shogun/lib/common.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
void set_num_threads(int32_t n)
Definition: Parallel.cpp:67
int32_t get_num_cpus() const
Definition: Parallel.cpp:54
int32_t get_num_threads() const
Definition: Parallel.cpp:78
int32_t ref()
Definition: Parallel.cpp:83
int32_t unref()
Definition: Parallel.cpp:93
virtual ~Parallel()
Definition: Parallel.cpp:49
int32_t ref_count() const
Definition: Parallel.cpp:88
Class Parallel provides helper functions for multithreading.
Definition: Parallel.h:27
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18

SHOGUN Machine Learning Toolbox - Documentation