#ifndef KOKKOS_OPENMPTARGET_HPP
#define KOKKOS_OPENMPTARGET_HPP
#include <Kokkos_Core_fwd.hpp>
#if defined( KOKKOS_ENABLE_OPENMPTARGET ) && defined( _OPENMP )
#include <omp.h>
#include <cstddef>
#include <iosfwd>
#include <Kokkos_OpenMPTargetSpace.hpp>
#include <Kokkos_ScratchSpace.hpp>
#include <Kokkos_Parallel.hpp>
#include <Kokkos_TaskPolicy.hpp>
#include <Kokkos_Layout.hpp>
#include <impl/Kokkos_Tags.hpp>
#include <KokkosExp_MDRangePolicy.hpp>
namespace Kokkos {
namespace Experimental {
class OpenMPTarget {
public:
typedef OpenMPTarget execution_space ;
typedef OpenMPTargetSpace memory_space ;
typedef Kokkos::Device<execution_space,memory_space> device_type;
typedef LayoutLeft array_layout ;
typedef memory_space::size_type size_type ;
typedef ScratchMemorySpace< OpenMPTarget > scratch_memory_space ;
inline static bool in_parallel() { return omp_in_parallel(); }
static bool sleep();
static bool wake();
static void fence() {}
static void print_configuration( std::ostream & , const bool detail = false );
static void finalize();
static void initialize( unsigned thread_count = 0 ,
unsigned use_numa_count = 0 ,
unsigned use_cores_per_numa = 0 );
static int is_initialized();
static int concurrency();
inline static int thread_pool_size( int depth = 0 );
KOKKOS_INLINE_FUNCTION static int thread_pool_rank();
inline static unsigned max_hardware_threads() { return thread_pool_size(0); }
KOKKOS_INLINE_FUNCTION static
unsigned hardware_thread_id() { return thread_pool_rank(); }
static const char* name();
private:
static bool m_is_initialized;
};
} }
namespace Kokkos {
namespace Impl {
template<>
struct VerifyExecutionCanAccessMemorySpace
< Kokkos::Experimental::OpenMPTarget::memory_space
, Kokkos::Experimental::OpenMPTarget::scratch_memory_space
>
{
enum { value = true };
inline static void verify( void ) { }
inline static void verify( const void * ) { }
};
} }
#include <OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp>
#include <OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp>
#include <OpenMPTarget/Kokkos_OpenMPTarget_Task.hpp>
#endif
#endif