Go to the documentation of this file.
33#ifndef SHARK_CORE_OPENMP_H
34#define SHARK_CORE_OPENMP_H
38#ifdef SHARK_USE_OPENMP
40#include <boost/config.hpp>
42#if defined(BOOST_MSVC) || defined(__INTEL_COMPILER)
43#define SHARK_PARALLEL_FOR __pragma(omp parallel for)\
46#define SHARK_CRITICAL_REGION __pragma(omp critical)
49#define SHARK_PARALLEL_FOR \
50_Pragma ( "omp parallel for" )\
53#define SHARK_CRITICAL_REGION _Pragma("omp critical (globalSharkLock)")
56#define SHARK_NUM_THREADS (std::size_t)(omp_in_parallel()?omp_get_num_threads():omp_get_max_threads())
57#define SHARK_THREAD_NUM (std::size_t)(omp_in_parallel()?omp_get_thread_num():0)
60#define SHARK_PARALLEL_FOR for
61#define SHARK_CRITICAL_REGION
62#define SHARK_NUM_THREADS (std::size_t)1
63#define SHARK_THREAD_NUM (std::size_t)0