| # error "A C or C++ compiler has been selected for CUDA" |
| #include <cuda_runtime.h> |
| #include "CMakeCompilerABI.h" |
| int main(int argc, char* argv[]) |
| require += info_sizeof_dptr[argc]; |
| require += info_byte_order_big_endian[argc]; |
| require += info_byte_order_little_endian[argc]; |
| require += info_abi[argc]; |
| if (cudaGetDeviceCount(&count) != cudaSuccess || count == 0) { |
| std::fprintf(stderr, "No CUDA devices found.\n"); |
| for (int device = 0; device < count; ++device) { |
| if (cudaGetDeviceProperties(&prop, device) == cudaSuccess) { |
| std::printf("%s%d%d", sep, prop.major, prop.minor); |
| std::fprintf(stderr, "No CUDA architecture detected from any devices.\n"); |
| // Convince the compiler that the non-zero return value depends |
| // on the info strings so they are not optimized out. |