44 #ifndef KOKKOS_CUDA_HPP 45 #define KOKKOS_CUDA_HPP 47 #include <Kokkos_Macros.hpp> 48 #if defined( KOKKOS_ENABLE_CUDA ) 50 #include <Kokkos_Core_fwd.hpp> 55 #include <Kokkos_CudaSpace.hpp> 58 #include <Kokkos_TaskScheduler.hpp> 60 #include <Kokkos_ScratchSpace.hpp> 61 #include <Kokkos_MemoryTraits.hpp> 62 #include <impl/Kokkos_Tags.hpp> 93 typedef Cuda execution_space ;
95 #if defined( KOKKOS_ENABLE_CUDA_UVM ) 96 typedef CudaUVMSpace memory_space ;
99 typedef CudaSpace memory_space ;
107 typedef memory_space::size_type size_type ;
110 typedef LayoutLeft array_layout ;
113 typedef ScratchMemorySpace< Cuda > scratch_memory_space ;
122 KOKKOS_INLINE_FUNCTION
static int in_parallel() {
123 #if defined( __CUDA_ARCH__ ) 162 static int is_initialized();
165 static int concurrency();
176 explicit Cuda(
const int instance_id );
178 Cuda( Cuda && ) = default ;
179 Cuda(
const Cuda & ) = default ;
180 Cuda & operator = ( Cuda && ) = default ;
181 Cuda & operator = (
const Cuda & ) = default ;
187 struct SelectDevice {
189 SelectDevice() : cuda_device_id(0) {}
190 explicit SelectDevice(
int id ) : cuda_device_id( id ) {}
194 static void initialize(
const SelectDevice = SelectDevice()
195 ,
const size_t num_instances = 1 );
200 static size_type device_arch();
203 static size_type detect_device_count();
208 static std::vector<unsigned> detect_device_arch();
210 cudaStream_t cuda_stream()
const {
return m_stream ; }
211 int cuda_device()
const {
return m_device ; }
216 static const char* name();
220 cudaStream_t m_stream ;
233 struct MemorySpaceAccess
235 , Kokkos::Cuda::scratch_memory_space
238 enum { assignable =
false };
239 enum { accessible =
true };
240 enum { deepcopy =
false };
243 #if defined( KOKKOS_ENABLE_CUDA_UVM ) 252 struct MemorySpaceAccess
254 , Kokkos::Cuda::scratch_memory_space
257 enum { assignable =
false };
258 enum { accessible =
true };
259 enum { deepcopy =
false };
266 struct VerifyExecutionCanAccessMemorySpace
268 , Kokkos::Cuda::scratch_memory_space
271 enum { value =
true };
272 KOKKOS_INLINE_FUNCTION
static void verify(
void ) { }
273 KOKKOS_INLINE_FUNCTION
static void verify(
const void * ) { }
277 struct VerifyExecutionCanAccessMemorySpace
279 , Kokkos::Cuda::scratch_memory_space
282 enum { value =
false };
283 inline static void verify(
void ) { CudaSpace::access_error(); }
284 inline static void verify(
const void * p ) { CudaSpace::access_error(p); }
293 #include <Cuda/Kokkos_CudaExec.hpp> 294 #include <Cuda/Kokkos_Cuda_View.hpp> 295 #include <Cuda/Kokkos_Cuda_Team.hpp> 296 #include <Cuda/Kokkos_Cuda_Parallel.hpp> 297 #include <Cuda/Kokkos_Cuda_Task.hpp> 299 #include <KokkosExp_MDRangePolicy.hpp> void print_configuration(std::ostream &, const bool detail=false)
Print "Bill of Materials".
Memory space for main process and CPU execution spaces.
Declaration of various MemoryLayout options.
Declaration of parallel operators.
void finalize()
Finalize the spaces that were initialized via Kokkos::initialize.