// Copyright Supranational LLC // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 // #include or compile separately... #if defined(__NVCC__) && !defined(__CUDA_ARCH__) #include extern "C" bool cuda_available() { static std::atomic available(-1); int ret = available; if (ret < 0) { cudaDeviceProp prop; ret = cudaGetDeviceProperties(&prop, 0) == cudaSuccess && prop.major >= 7; available = ret; } return (bool)ret; } #endif