diff --git a/target/offload.h b/target/offload.h index 12637e7..f952a28 100644 --- a/target/offload.h +++ b/target/offload.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include "openmp.h" #include "util.h" inline const char *get_variant_string() diff --git a/target/openmp.h b/target/openmp.h index ba7da99..9ed9346 100644 --- a/target/openmp.h +++ b/target/openmp.h @@ -39,13 +39,23 @@ OpenMP wrapper for headerfile #ifdef _OPENMP #include #else -inline int omp_get_thread_num() { return 0; } -inline int omp_get_max_threads() { return 1; } -inline void omp_set_num_threads(int num_threads) { return 1; } -inline int __sync_fetch_and_add(int *ptr, int value) + +#ifndef OPENMP_H +#define OPENMP_H + +inline int omp_get_thread_num() { return 0; } +inline int omp_get_max_threads() { return 1; } +inline void omp_set_num_threads(int num_threads) { ; } +inline int omp_get_num_teams(void) { return 1; } +inline int omp_get_team_num(void) { return 0; } +inline int omp_is_initial_device(void) { return 1; } +inline int __sync_fetch_and_add(int *ptr, int value) { int tmp = *ptr; ptr[0] += value; return tmp; } + #endif + +#endif \ No newline at end of file diff --git a/target/thermo.cpp b/target/thermo.cpp index c1837b4..6bfaf01 100644 --- a/target/thermo.cpp +++ b/target/thermo.cpp @@ -37,7 +37,7 @@ #include "stdio.h" #include "stdlib.h" #include "util.h" -#include +#include "openmp.h" Thermo::Thermo() {} Thermo::~Thermo() {}