NFFT
3.3.0
Main Page
Modules
Data Structures
Files
File List
Globals
kernel
util
thread.c
1
/*
2
* Copyright (c) 2002, 2015 Jens Keiner, Stefan Kunis, Daniel Potts
3
*
4
* This program is free software; you can redistribute it and/or modify it under
5
* the terms of the GNU General Public License as published by the Free Software
6
* Foundation; either version 2 of the License, or (at your option) any later
7
* version.
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
* details.
13
*
14
* You should have received a copy of the GNU General Public License along with
15
* this program; if not, write to the Free Software Foundation, Inc., 51
16
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
*/
18
19
/* $Id: util.c 3483 2010-04-23 19:02:34Z keiner $ */
20
21
#include "infft.h"
22
23
#ifdef _OPENMP
24
#include <omp.h>
25
#endif
26
27
INT Y(get_num_threads)(void)
28
{
29
#ifdef _OPENMP
30
INT nthreads;
31
#pragma omp parallel default(shared)
32
{
33
INT n = (INT)omp_get_num_threads();
34
#pragma omp master
35
{
36
nthreads = n;
37
}
38
}
39
return
nthreads;
40
#else
41
return
1;
42
#endif
43
}
Generated by
1.8.9.1