imate
C++/CUDA Reference
Loading...
Searching...
No Matches
conditional_openmp.cpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu>
3
* SPDX-License-Identifier: BSD-3-Clause
4
* SPDX-FileType: SOURCE
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the license found in the LICENSE.txt file in the root
8
* directory of this source tree.
9
*/
10
11
12
// =======
13
// Headers
14
// =======
15
16
#include "
./conditional_openmp.h
"
// use_openmp
17
18
19
// Nullify all openmp functions
20
#if !defined(USE_OPENMP) || (USE_OPENMP != 1)
21
22
// =============
23
// omp init lock
24
// =============
25
26
void
omp_init_lock
(
omp_lock_t
*lock)
27
{
28
(void) lock;
29
}
30
31
// ============
32
// omp set lock
33
// ============
34
35
void
omp_set_lock
(
omp_lock_t
*lock)
36
{
37
(void) lock;
38
}
39
40
// ==============
41
// omp unset lock
42
// ==============
43
44
void
omp_unset_lock
(
omp_lock_t
*lock)
45
{
46
(void) lock;
47
}
48
49
// ===================
50
// omp get max threads
51
// ===================
52
53
int
omp_get_max_threads
()
54
{
55
return
1;
56
}
57
58
// ==================
59
// omp get thread num
60
// ==================
61
62
int
omp_get_thread_num
()
63
{
64
return
0;
65
}
66
67
// ===================
68
// omp set num threads
69
// ===================
70
71
void
omp_set_num_threads
(
int
num_threads)
72
{
73
(void) num_threads;
74
}
75
76
#endif
omp_unset_lock
void omp_unset_lock(omp_lock_t *lock)
Definition
conditional_openmp.cpp:44
omp_get_max_threads
int omp_get_max_threads()
Definition
conditional_openmp.cpp:53
omp_set_lock
void omp_set_lock(omp_lock_t *lock)
Definition
conditional_openmp.cpp:35
omp_set_num_threads
void omp_set_num_threads(int num_threads)
Definition
conditional_openmp.cpp:71
omp_get_thread_num
int omp_get_thread_num()
Definition
conditional_openmp.cpp:62
omp_init_lock
void omp_init_lock(omp_lock_t *lock)
Definition
conditional_openmp.cpp:26
conditional_openmp.h
omp_lock_t
int omp_lock_t
Definition
conditional_openmp.h:25
imate
_openmp
conditional_openmp.cpp
Generated on Tue May 12 2026 22:54:38 for imate by
1.9.8