-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Strip host-compiler -std flag from NVCC line.
Closes #8523.
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |