19 #if defined(KOKKOS_ENABLE_CUDA)
21 CudaInfo::CudaInfo() : initialized_(false), mediumPrio_(0) {}
25 #if defined(KOKKOS_ENABLE_CUDA)
26 if (!cudaInfo.initialized_) {
27 cudaInfo.initialized_ =
true;
28 TPETRA_DETAILS_SPACES_CUDA_RUNTIME(cudaEventCreateWithFlags(
29 &cudaInfo.execSpaceWaitEvent_, cudaEventDisableTiming));
30 TPETRA_DETAILS_SPACES_CUDA_RUNTIME(cudaDeviceGetStreamPriorityRange(
31 &cudaInfo.lowPrio_, &cudaInfo.highPrio_));
38 if (!(cudaInfo.lowPrio_ >= cudaInfo.mediumPrio_ &&
39 cudaInfo.mediumPrio_ >= cudaInfo.highPrio_)) {
41 ss <<
"CUDA stream priority does not follow assumptions."
42 <<
" low=" << cudaInfo.lowPrio_ <<
" medium=" << cudaInfo.mediumPrio_
43 <<
" high=" << cudaInfo.highPrio_
44 <<
" Please report this to the Tpetra developers.";
45 throw std::runtime_error(ss.str());
55 #if defined(KOKKOS_ENABLE_CUDA)
56 InstanceLifetimeManager<Kokkos::Cuda> cudaSpaces;
59 #ifdef KOKKOS_ENABLE_SERIAL
60 InstanceLifetimeManager<Kokkos::Serial> serialSpaces;
62 #ifdef KOKKOS_ENABLE_OPENMP
63 InstanceLifetimeManager<Kokkos::OpenMP> openMPSpaces;
65 #ifdef KOKKOS_ENABLE_HIP
66 InstanceLifetimeManager<Kokkos::HIP> HIPSpaces;
68 #ifdef KOKKOS_ENABLE_SYCL
69 InstanceLifetimeManager<Kokkos::Experimental::SYCL> SYCLSpaces;