#ifndef KOKKOS_QTHREADS_HPP
#define KOKKOS_QTHREADS_HPP
#include <Kokkos_Macros.hpp>
#if defined( KOKKOS_ENABLE_QTHREADS )
#include <Kokkos_Core_fwd.hpp>
#define QTHREAD_LOCAL_PRIORITY
#define CLONED_TASKS
#include <qthread.h>
#include <cstddef>
#include <iosfwd>
#include <Kokkos_HostSpace.hpp>
#include <Kokkos_ScratchSpace.hpp>
#include <Kokkos_Parallel.hpp>
#include <Kokkos_Layout.hpp>
#include <impl/Kokkos_Tags.hpp>
#include <KokkosExp_MDRangePolicy.hpp>
namespace Kokkos {
namespace Impl {
class QthreadsExec;
}
}
namespace Kokkos {
class Qthreads {
public:
typedef Qthreads execution_space;
typedef Kokkos::HostSpace memory_space;
typedef Kokkos::Device< execution_space, memory_space > device_type;
typedef Kokkos::LayoutRight array_layout;
typedef memory_space::size_type size_type;
typedef ScratchMemorySpace< Qthreads > scratch_memory_space;
static Qthreads & instance( int = 0 );
bool sleep();
static bool wake();
static void fence();
static int in_parallel();
static int is_initialized();
static int concurrency();
static void initialize( int thread_count );
static void finalize();
static void print_configuration( std::ostream &, const bool detail = false );
int shepherd_size() const;
int shepherd_worker_size() const;
static const char* name();
};
}
namespace Kokkos {
namespace Impl {
template<>
struct MemorySpaceAccess
< Kokkos::Qthreads::memory_space
, Kokkos::Qthreads::scratch_memory_space
>
{
enum { assignable = false };
enum { accessible = true };
enum { deepcopy = false };
};
template<>
struct VerifyExecutionCanAccessMemorySpace
< Kokkos::Qthreads::memory_space
, Kokkos::Qthreads::scratch_memory_space
>
{
enum { value = true };
inline static void verify( void ) {}
inline static void verify( const void * ) {}
};
}
}
#include <Qthreads/Kokkos_QthreadsExec.hpp>
#include <Qthreads/Kokkos_Qthreads_Parallel.hpp>
#endif #endif