44 #ifndef KOKKOS_CORE_FWD_HPP 45 #define KOKKOS_CORE_FWD_HPP 51 #include <Kokkos_Macros.hpp> 52 #include <impl/Kokkos_Utilities.hpp> 57 static_assert(
sizeof(
void*) == 8
58 ,
"Kokkos assumes 64-bit build; i.e., 8-byte pointers" );
65 KOKKOS_INLINE_FUNCTION
66 constexpr
const AUTO_t & operator()()
const {
return *
this; }
71 constexpr AUTO_t AUTO = Kokkos::AUTO_t();
74 struct InvalidType {};
85 #ifdef KOKKOS_ENABLE_HBWSPACE 91 #if defined( KOKKOS_ENABLE_SERIAL ) 95 #if defined( KOKKOS_ENABLE_QTHREADS ) 99 #if defined( KOKKOS_ENABLE_THREADS ) 103 #if defined( KOKKOS_ENABLE_OPENMP ) 107 #if defined( KOKKOS_ENABLE_OPENMPTARGET ) 110 class OpenMPTargetSpace;
115 #if defined( KOKKOS_ENABLE_CUDA ) 118 class CudaHostPinnedSpace;
122 template<
class ExecutionSpace,
class MemorySpace>
136 #if defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA ) 137 typedef Cuda DefaultExecutionSpace;
138 #elif defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMPTARGET ) 139 typedef Experimental::OpenMPTarget DefaultExecutionSpace ;
140 #elif defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP ) 141 typedef OpenMP DefaultExecutionSpace;
142 #elif defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS ) 143 typedef Threads DefaultExecutionSpace;
146 #elif defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL ) 147 typedef Serial DefaultExecutionSpace;
149 # error "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::Cuda, Kokkos::Experimental::OpenMPTarget, Kokkos::OpenMP, Kokkos::Threads, Kokkos::Qthreads, or Kokkos::Serial." 152 #if defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP ) 153 typedef OpenMP DefaultHostExecutionSpace;
154 #elif defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS ) 155 typedef Threads DefaultHostExecutionSpace;
158 #elif defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL ) 159 typedef Serial DefaultHostExecutionSpace;
160 #elif defined( KOKKOS_ENABLE_OPENMP ) 161 typedef OpenMP DefaultHostExecutionSpace;
162 #elif defined( KOKKOS_ENABLE_THREADS ) 163 typedef Threads DefaultHostExecutionSpace;
166 #elif defined( KOKKOS_ENABLE_SERIAL ) 167 typedef Serial DefaultHostExecutionSpace;
169 # error "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::OpenMP, Kokkos::Threads, Kokkos::Qthreads, or Kokkos::Serial." 183 #if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA ) && defined( KOKKOS_ENABLE_CUDA ) 184 typedef Kokkos::CudaSpace ActiveExecutionMemorySpace;
185 #elif defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) 188 typedef void ActiveExecutionMemorySpace;
191 template<
class ActiveSpace,
class MemorySpace >
192 struct VerifyExecutionCanAccessMemorySpace {
196 template<
class Space >
197 struct VerifyExecutionCanAccessMemorySpace< Space, Space >
200 KOKKOS_INLINE_FUNCTION
static void verify(
void) {}
201 KOKKOS_INLINE_FUNCTION
static void verify(
const void *) {}
208 #define KOKKOS_RESTRICT_EXECUTION_TO_DATA( DATA_SPACE, DATA_PTR ) \ 209 Kokkos::Impl::VerifyExecutionCanAccessMemorySpace< \ 210 Kokkos::Impl::ActiveExecutionMemorySpace, DATA_SPACE >::verify( DATA_PTR ) 212 #define KOKKOS_RESTRICT_EXECUTION_TO_( DATA_SPACE ) \ 213 Kokkos::Impl::VerifyExecutionCanAccessMemorySpace< \ 214 Kokkos::Impl::ActiveExecutionMemorySpace, DATA_SPACE >::verify() 228 template<
class Functor
230 ,
class EnableFunctor = void
231 ,
class EnablePolicy =
void 242 template<
class FunctorType,
class ExecPolicy,
class ExecutionSpace =
243 typename Impl::FunctorPolicyExecutionSpace< FunctorType, ExecPolicy >::execution_space
251 template<
class FunctorType,
class ExecPolicy,
class ReducerType = InvalidType,
class ExecutionSpace =
252 typename Impl::FunctorPolicyExecutionSpace< FunctorType, ExecPolicy >::execution_space
261 template<
class FunctorType,
class ExecPolicy,
class ExecutionSapce =
262 typename Impl::FunctorPolicyExecutionSpace< FunctorType, ExecPolicy >::execution_space
268 template<
class ScalarType ,
class Space = HostSpace>
struct Sum;
269 template<
class ScalarType ,
class Space = HostSpace>
struct Prod;
270 template<
class ScalarType ,
class Space = HostSpace>
struct Min;
271 template<
class ScalarType ,
class Space = HostSpace>
struct Max;
272 template<
class ScalarType ,
class Space = HostSpace>
struct MinMax;
273 template<
class ScalarType ,
class Index,
class Space = HostSpace>
struct MinLoc;
274 template<
class ScalarType ,
class Index,
class Space = HostSpace>
struct MaxLoc;
275 template<
class ScalarType ,
class Index,
class Space = HostSpace>
struct MinMaxLoc;
276 template<
class ScalarType ,
class Space = HostSpace>
struct BAnd;
277 template<
class ScalarType ,
class Space = HostSpace>
struct BOr;
278 template<
class ScalarType ,
class Space = HostSpace>
struct LAnd;
279 template<
class ScalarType ,
class Space = HostSpace>
struct LOr;
Implementation detail of parallel_scan.
Memory management for host memory.
Implementation of the ParallelFor operator that has a partial specialization for the device...
Given a Functor and Execution Policy query an execution space.
Implementation detail of parallel_reduce.