SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
Parallel.h
浏览该文件的文档.
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:56
int32_t get_num_cpus() const
Definition: Parallel.cpp:43
int32_t get_num_threads() const
Definition: Parallel.cpp:64
int32_t ref()
Definition: Parallel.cpp:69
int32_t unref()
Definition: Parallel.cpp:79
virtual ~Parallel()
Definition: Parallel.cpp:38
int32_t ref_count() const
Definition: Parallel.cpp:74
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 机器学习工具包 - 项目文档