40 #ifndef TPETRA_DETAILS_CHECKLAUNCHBLOCKING_HPP
41 #define TPETRA_DETAILS_CHECKLAUNCHBLOCKING_HPP
43 #include "TpetraCore_config.h"
46 #include "Kokkos_Core.hpp"
50 #ifdef HAVE_TPETRACORE_CUDA
52 inline void checkOldCudaLaunchBlocking()
54 if(!Kokkos::is_initialized())
55 throw std::logic_error(
"Kokkos must be initialized in order to check CUDA_LAUNCH_BLOCKING setting.");
56 size_t arch = Kokkos::Cuda::device_arch();
60 const char* launchBlockingEnv = std::getenv(
"CUDA_LAUNCH_BLOCKING");
61 if(!launchBlockingEnv || strcmp(launchBlockingEnv,
"1"))
63 throw std::runtime_error(
64 "Tpetra::initialize(): Kokkos was compiled for an older CUDA architecture than Pascal, but\n"
65 "the environment variable CUDA_LAUNCH_BLOCKING is either unset or is not \"1\".\n"
66 "It must be set to \"1\" at runtime.\n");
71 inline void checkOldCudaLaunchBlocking() {}