Bridge++
Ver. 2.0.2
fopr_thread-inc.h
Go to the documentation of this file.
1
10
#ifndef FOPR_THREAD_INC_INCLUDED
11
#define FOPR_THREAD_INC_INCLUDED
12
13
#include "
ResourceManager/threadManager.h
"
14
15
namespace
{
16
// Equal tasks for all threads
17
inline
void
set_threadtask(
int
& ith,
int
& nth,
int
& is,
int
& ns,
18
const
int
size)
19
{
20
nth =
ThreadManager::get_num_threads
();
21
ith =
ThreadManager::get_thread_id
();
22
23
size_t
is2 = size_t(size) * size_t(ith) / nth;
24
size_t
ns2 = size_t(size) * size_t(ith + 1) / nth;
25
is = int(is2);
26
ns = int(ns2);
27
}
28
}
29
30
#endif
31
//============================================================END=====
ThreadManager::get_num_threads
static int get_num_threads()
returns available number of threads.
Definition:
threadManager.cpp:246
threadManager.h
ThreadManager::get_thread_id
static int get_thread_id()
returns thread id.
Definition:
threadManager.cpp:253
src
lib
Fopr
fopr_thread-inc.h
Generated on Sat Feb 10 2024 14:19:59 for Bridge++ by
1.8.17