imate
C++/CUDA Reference
Loading...
Searching...
No Matches
conditional_openmp.h
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#ifndef CONDITIONAL_OPENMP_H_
13#define CONDITIONAL_OPENMP_H_
14
15// =======
16// Headers
17// =======
18
19#if defined(USE_OPENMP) && (USE_OPENMP == 1)
20 #include <omp.h>
21 #define use_openmp 1
22#else
23
24 #define use_openmp 0
25 typedef int omp_lock_t;
26 void omp_init_lock(omp_lock_t *lock);
27 void omp_set_lock(omp_lock_t *lock);
28 void omp_unset_lock(omp_lock_t *lock);
31 void omp_set_num_threads(int num_threads);
32
33#endif
34
35
36#endif // CONDITIONAL_OPENMP_H_
void omp_unset_lock(omp_lock_t *lock)
int omp_lock_t
int omp_get_max_threads()
void omp_set_lock(omp_lock_t *lock)
void omp_set_num_threads(int num_threads)
int omp_get_thread_num()
void omp_init_lock(omp_lock_t *lock)