Skip to content

Commit

Permalink
OpenMP backend refactor files. (kokkos#6403)
Browse files Browse the repository at this point in the history
* OpenMP: Refactor files into parallel patterns.

* OpenMP: correct include file path.

* OpenMP: clang-format.

* OpenMP: Remove KOKKOS_ENABLE_OPENMP macro.

* OpenMP: include Kokkos_Parallel.hpp file.

* OpenMP: Re-introduce KOKKOS_ENABLE_OPENMP.

* OpenMP: Remove KOKKOS_ENABLE_OPENMP macro.

* OpenMP: remove macros include file.

* OpenMP: Fix spell mistake.

---------

Co-authored-by: Rahulkumar Gayatri <rgayatri@lbl.gov>
  • Loading branch information
Rahulkumar Gayatri and Rahulkumar Gayatri committed Sep 6, 2023
1 parent c53a95e commit 3c97512
Show file tree
Hide file tree
Showing 8 changed files with 1,327 additions and 1,270 deletions.
1 change: 0 additions & 1 deletion core/src/OpenMP/Kokkos_OpenMP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ struct MemorySpaceAccess<Kokkos::OpenMP::memory_space,

#include <OpenMP/Kokkos_OpenMP_Instance.hpp>
#include <OpenMP/Kokkos_OpenMP_Team.hpp>
#include <OpenMP/Kokkos_OpenMP_Parallel.hpp>
#include <OpenMP/Kokkos_OpenMP_Task.hpp>

#include <KokkosExp_MDRangePolicy.hpp>
Expand Down
12 changes: 12 additions & 0 deletions core/src/OpenMP/Kokkos_OpenMP_Instance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
#include <type_traits>
#include <vector>

/*--------------------------------------------------------------------------*/
namespace Kokkos {
namespace Impl {

inline bool execute_in_serial(OpenMP const& space = OpenMP()) {
return (OpenMP::in_parallel(space) &&
!(omp_get_nested() && (omp_get_level() == 1)));
}

} // namespace Impl
} // namespace Kokkos

namespace Kokkos {
namespace Impl {

Expand Down

0 comments on commit 3c97512

Please sign in to comment.