10#ifndef TPETRA_DETAILS_CHECKLAUNCHBLOCKING_HPP
11#define TPETRA_DETAILS_CHECKLAUNCHBLOCKING_HPP
13#include "TpetraCore_config.h"
16#include "Kokkos_Core.hpp"
20#if defined(HAVE_TPETRACORE_CUDA) && defined(KOKKOS_ENABLE_DEPRECATED_CODE_4)
22inline void checkOldCudaLaunchBlocking() {
23 if (!Kokkos::is_initialized())
24 throw std::logic_error(
"Kokkos must be initialized in order to check CUDA_LAUNCH_BLOCKING setting.");
25 size_t arch = Kokkos::Cuda::device_arch();
28 const char* launchBlockingEnv = std::getenv(
"CUDA_LAUNCH_BLOCKING");
29 if (!launchBlockingEnv || strcmp(launchBlockingEnv,
"1")) {
30 throw std::runtime_error(
31 "Tpetra::initialize(): Kokkos was compiled for an older CUDA architecture than Pascal, but\n"
32 "the environment variable CUDA_LAUNCH_BLOCKING is either unset or is not \"1\".\n"
33 "It must be set to \"1\" at runtime.\n");
38inline void checkOldCudaLaunchBlocking() {}
Implementation details of Tpetra.
Namespace Tpetra contains the class and methods constituting the Tpetra library.