18#if defined(AUTOPAS_USE_OPENMP)
29#if defined(AUTOPAS_USE_OPENMP)
35#define AUTOPAS_DO_PRAGMA(x) _Pragma(#x)
43#define AUTOPAS_OPENMP(args) AUTOPAS_DO_PRAGMA(omp args)
103 void lock() { omp_set_lock(&_lock); }
108 void unlock() { omp_unset_lock(&_lock); }
118#pragma omp declare reduction(vecMerge : std::vector<size_t> : omp_out.insert(omp_out.end(), omp_in.begin(), omp_in.end()))
119#pragma omp declare reduction(vecMerge : std::vector<double> : omp_out.insert(omp_out.end(), omp_in.begin(), omp_in.end()))
126#define AUTOPAS_OPENMP(args)
215static_assert(std::is_default_constructible_v<AutoPasLock>,
"AutoPasLock needs to be default constructible!");
216static_assert(std::is_move_constructible_v<AutoPasLock>,
"AutoPasLock needs to be move constructible!");
AutoPasLock for the sequential case.
Definition: WrapOpenMP.h:155
AutoPasLock(AutoPasLock &)
Copy constructor.
Definition: WrapOpenMP.h:170
AutoPasLock()
Default constructor.
Definition: WrapOpenMP.h:160
AutoPasLock(AutoPasLock &&) noexcept
Move Constructor.
Definition: WrapOpenMP.h:165
AutoPasLock & operator=(AutoPasLock)=delete
Assignment operator.
~AutoPasLock()
Destructor.
Definition: WrapOpenMP.h:181
void unlock()
Release the lock.
Definition: WrapOpenMP.h:200
void lock()
Acquire the lock.
Definition: WrapOpenMP.h:190
static void exception(const Exception e)
Handle an exception derived by std::exception.
Definition: ExceptionHandler.h:63
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:32
int autopas_get_num_threads()
Dummy for omp_get_num_threads() when no OpenMP is available.
Definition: WrapOpenMP.h:138
void autopas_set_num_threads(int)
Wrapper for omp_set_num_threads().
Definition: WrapOpenMP.h:150
int autopas_get_max_threads()
Dummy for omp_get_max_threads() when no OpenMP is available.
Definition: WrapOpenMP.h:144
int autopas_get_thread_num()
Dummy for omp_set_lock() when no OpenMP is available.
Definition: WrapOpenMP.h:132