10 #ifndef TPETRA_DETAILS_CHECKLAUNCHBLOCKING_HPP
11 #define TPETRA_DETAILS_CHECKLAUNCHBLOCKING_HPP
13 #include "TpetraCore_config.h"
16 #include "Kokkos_Core.hpp"
20 #ifdef HAVE_TPETRACORE_CUDA
22 inline void checkOldCudaLaunchBlocking()
24 if(!Kokkos::is_initialized())
25 throw std::logic_error(
"Kokkos must be initialized in order to check CUDA_LAUNCH_BLOCKING setting.");
26 size_t arch = Kokkos::Cuda::device_arch();
30 const char* launchBlockingEnv = std::getenv(
"CUDA_LAUNCH_BLOCKING");
31 if(!launchBlockingEnv || strcmp(launchBlockingEnv,
"1"))
33 throw std::runtime_error(
34 "Tpetra::initialize(): Kokkos was compiled for an older CUDA architecture than Pascal, but\n"
35 "the environment variable CUDA_LAUNCH_BLOCKING is either unset or is not \"1\".\n"
36 "It must be set to \"1\" at runtime.\n");
41 inline void checkOldCudaLaunchBlocking() {}