parent
5941e94ff8
commit
2579420a72
3 changed files with 36 additions and 1 deletions
@ -0,0 +1,20 @@ |
||||
#include <cuda_runtime.h> |
||||
#include <iostream> |
||||
|
||||
auto cuda_devices(void) { |
||||
int result = 0; |
||||
cudaGetDeviceCount(&result); |
||||
return result; |
||||
} |
||||
|
||||
|
||||
int main(void) { |
||||
int n = cuda_devices(); |
||||
if (n == 0) { |
||||
std::cout << "No Cuda hardware found. Exiting.\n"; |
||||
return 0; |
||||
} |
||||
|
||||
std::cout << "Found " << n << "Cuda devices.\n"; |
||||
return 0; |
||||
} |
@ -0,0 +1,4 @@ |
||||
project('C++-CUDA multi-std', 'cpp', 'cuda', version : '1.0.0', default_options : ['cpp_std=c++17', 'cuda_std=c++14']) |
||||
|
||||
exe = executable('prog', 'main.cu') |
||||
test('cudatest', exe) |
Loading…
Reference in new issue