17 #ifndef KOKKOS_CORE_FWD_HPP 18 #define KOKKOS_CORE_FWD_HPP 19 #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE 20 #define KOKKOS_IMPL_PUBLIC_INCLUDE 21 #define KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE_FWD 28 #include <Kokkos_Macros.hpp> 29 #include <impl/Kokkos_Error.hpp> 30 #include <impl/Kokkos_Utilities.hpp> 32 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 33 #include <Kokkos_MasterLock.hpp> 39 static_assert(
sizeof(
void *) == 8,
40 "Kokkos assumes 64-bit build; i.e., 8-byte pointers");
47 KOKKOS_INLINE_FUNCTION
48 constexpr
const AUTO_t &operator()()
const {
return *
this; }
54 constexpr AUTO_t AUTO = Kokkos::AUTO_t();
57 struct InvalidType {};
69 template <
class ExecutionSpace,
class MemorySpace>
73 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 76 class InitializationSettings;
81 #include <KokkosCore_Config_FwdBackend.hpp> 91 #if defined(__clang_analyzer__) 92 #define KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION \ 93 [[clang::annotate("DefaultExecutionSpace")]] 94 #define KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION \ 95 [[clang::annotate("DefaultHostExecutionSpace")]] 97 #define KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION 98 #define KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION 103 #if defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA) 104 using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = Cuda;
105 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMPTARGET) 106 using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION =
107 Experimental::OpenMPTarget;
108 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_HIP) 109 using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = HIP;
110 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SYCL) 111 using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION =
113 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENACC) 114 using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION =
115 Experimental::OpenACC;
116 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP) 117 using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = OpenMP;
118 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS) 119 using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = Threads;
120 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_HPX) 121 using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION =
122 Kokkos::Experimental::HPX;
123 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL) 124 using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = Serial;
127 "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::Cuda, Kokkos::HIP, Kokkos::Experimental::SYCL, Kokkos::Experimental::OpenMPTarget, Kokkos::Experimental::OpenACC, Kokkos::OpenMP, Kokkos::Threads, Kokkos::Experimental::HPX, or Kokkos::Serial." 130 #if defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP) 131 using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION =
133 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS) 134 using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION =
136 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_HPX) 137 using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION =
138 Kokkos::Experimental::HPX;
139 #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL) 140 using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION =
142 #elif defined(KOKKOS_ENABLE_OPENMP) 143 using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION =
145 #elif defined(KOKKOS_ENABLE_THREADS) 146 using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION =
148 #elif defined(KOKKOS_ENABLE_HPX) 149 using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION =
150 Kokkos::Experimental::HPX;
151 #elif defined(KOKKOS_ENABLE_SERIAL) 152 using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION =
156 "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::OpenMP, Kokkos::Threads, Kokkos::Experimental::HPX, or Kokkos::Serial." 160 #if defined(KOKKOS_ENABLE_CUDA) 161 using SharedSpace = CudaUVMSpace;
162 #define KOKKOS_HAS_SHARED_SPACE 163 #elif defined(KOKKOS_ENABLE_HIP) 164 using SharedSpace = HIPManagedSpace;
165 #define KOKKOS_HAS_SHARED_SPACE 166 #elif defined(KOKKOS_ENABLE_SYCL) 167 using SharedSpace = Experimental::SYCLSharedUSMSpace;
168 #define KOKKOS_HAS_SHARED_SPACE 170 #elif !defined(KOKKOS_ENABLE_OPENACC) && !defined(KOKKOS_ENABLE_OPENMPTARGET) 171 using SharedSpace = HostSpace;
172 #define KOKKOS_HAS_SHARED_SPACE 175 inline constexpr
bool has_shared_space =
176 #if defined KOKKOS_HAS_SHARED_SPACE 182 #if defined(KOKKOS_ENABLE_CUDA) 183 using SharedHostPinnedSpace = CudaHostPinnedSpace;
184 #define KOKKOS_HAS_SHARED_HOST_PINNED_SPACE 185 #elif defined(KOKKOS_ENABLE_HIP) 186 using SharedHostPinnedSpace = HIPHostPinnedSpace;
187 #define KOKKOS_HAS_SHARED_HOST_PINNED_SPACE 188 #elif defined(KOKKOS_ENABLE_SYCL) 189 using SharedHostPinnedSpace = Experimental::SYCLHostUSMSpace;
190 #define KOKKOS_HAS_SHARED_HOST_PINNED_SPACE 191 #elif !defined(KOKKOS_ENABLE_OPENACC) && !defined(KOKKOS_ENABLE_OPENMPTARGET) 192 using SharedHostPinnedSpace = HostSpace;
193 #define KOKKOS_HAS_SHARED_HOST_PINNED_SPACE 196 inline constexpr
bool has_shared_host_pinned_space =
197 #if defined KOKKOS_HAS_SHARED_HOST_PINNED_SPACE 212 template <
class AccessSpace,
class MemorySpace>
213 struct SpaceAccessibility;
218 template <
class MemorySpace,
class AccessSpace,
219 bool = SpaceAccessibility<AccessSpace, MemorySpace>::accessible>
220 struct RuntimeCheckMemoryAccessViolation {
221 KOKKOS_FUNCTION RuntimeCheckMemoryAccessViolation(
char const *
const) {}
226 template <
class MemorySpace,
class AccessSpace>
227 struct RuntimeCheckMemoryAccessViolation<MemorySpace, AccessSpace, false> {
228 KOKKOS_FUNCTION RuntimeCheckMemoryAccessViolation(
char const *
const msg) {
235 template <
class MemorySpace>
236 KOKKOS_FUNCTION
void runtime_check_memory_access_violation() {
238 RuntimeCheckMemoryAccessViolation<MemorySpace, DefaultHostExecutionSpace>(
239 "ERROR: attempt to access inaccessible memory space");))
241 (RuntimeCheckMemoryAccessViolation<MemorySpace, DefaultExecutionSpace>(
242 "ERROR: attempt to access inaccessible memory space");))
247 template <class MemorySpace>
248 KOKKOS_FUNCTION
void runtime_check_memory_access_violation(
249 char const *const msg) {
251 (
void)RuntimeCheckMemoryAccessViolation<MemorySpace,
252 DefaultHostExecutionSpace>(msg);))
253 KOKKOS_IF_ON_DEVICE((
255 RuntimeCheckMemoryAccessViolation<MemorySpace, DefaultExecutionSpace>(
262 template <
class,
class,
class,
class>
274 #ifdef KOKKOS_COMPILER_INTEL 276 void fence(
const std::string &name);
278 void fence(
const std::string &name =
"Kokkos::fence: Unnamed Global Fence");
286 template <
class DataType,
class... Properties>
291 template <
class DstSpace,
class SrcSpace,
292 class ExecutionSpace =
typename DstSpace::execution_space,
296 template <
typename ExecutionSpace,
class DT,
class... DP>
299 template <
class ViewType,
class Layout =
typename ViewType::array_layout,
300 class ExecSpace =
typename ViewType::execution_space,
301 int Rank = ViewType::Rank,
typename iType = int64_t>
304 template <
class ViewTypeA,
class ViewTypeB,
class Layout,
class ExecSpace,
305 int Rank,
typename iType>
308 template <
class Functor,
class Policy>
318 template <
class FunctorType,
class ExecPolicy,
320 FunctorType, ExecPolicy>::execution_space>
328 template <
class FunctorType,
class ExecPolicy,
class ReducerType = InvalidType,
330 FunctorType, ExecPolicy>::execution_space>
339 template <
class FunctorType,
class ExecPolicy,
341 FunctorType, ExecPolicy>::execution_space>
344 template <
class FunctorType,
class ExecPolicy,
class ReturnType = InvalidType,
346 FunctorType, ExecPolicy>::execution_space>
347 class ParallelScanWithTotal;
351 template <
class ScalarType,
class Space = HostSpace>
353 template <
class ScalarType,
class Space = HostSpace>
355 template <
class ScalarType,
class Space = HostSpace>
357 template <
class ScalarType,
class Space = HostSpace>
359 template <
class ScalarType,
class Space = HostSpace>
361 template <
class ScalarType,
class Index,
class Space = HostSpace>
363 template <
class ScalarType,
class Index,
class Space = HostSpace>
365 template <
class ScalarType,
class Index,
class Space = HostSpace>
367 template <
class ScalarType,
class Space = HostSpace>
369 template <
class ScalarType,
class Space = HostSpace>
371 template <
class ScalarType,
class Space = HostSpace>
373 template <
class ScalarType,
class Space = HostSpace>
376 template <
class Scalar,
class Index,
class Space = HostSpace>
378 template <
class Scalar,
class Index,
class ComparatorType,
380 struct MaxFirstLocCustomComparator;
382 template <
class Scalar,
class Index,
class Space = HostSpace>
384 template <
class Scalar,
class Index,
class ComparatorType,
386 struct MinFirstLocCustomComparator;
388 template <
class Scalar,
class Index,
class Space = HostSpace>
389 struct MinMaxFirstLastLoc;
390 template <
class Scalar,
class Index,
class ComparatorType,
392 struct MinMaxFirstLastLocCustomComparator;
394 template <
class Index,
class Space = HostSpace>
396 template <
class Index,
class Space = HostSpace>
398 template <
class Index,
class Space = HostSpace>
399 struct StdIsPartitioned;
400 template <
class Index,
class Space = HostSpace>
401 struct StdPartitionPoint;
404 #ifdef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE_FWD 405 #undef KOKKOS_IMPL_PUBLIC_INCLUDE 406 #undef KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE_FWD
Implementation detail of parallel_scan.
View to an array of data.
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.
LogicalMemorySpace is a space that is identical to another space, but differentiable by name and temp...