diff options
Diffstat (limited to 'Tests/Cuda/ObjectLibrary/Conflicts/static.cu')
-rw-r--r-- | Tests/Cuda/ObjectLibrary/Conflicts/static.cu | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/Cuda/ObjectLibrary/Conflicts/static.cu b/Tests/Cuda/ObjectLibrary/Conflicts/static.cu new file mode 100644 index 0000000..586e8c6 --- /dev/null +++ b/Tests/Cuda/ObjectLibrary/Conflicts/static.cu @@ -0,0 +1,17 @@ + +#include <cuda.h> +#include <cuda_runtime.h> +#include <iostream> + +int __host__ cu2_sq_func(int x) +{ + cudaError_t err; + int nDevices = 0; + err = cudaGetDeviceCount(&nDevices); + if (err != cudaSuccess) { + std::cerr << "nDevices: " << nDevices << std::endl; + std::cerr << "err: " << err << std::endl; + return 1; + } + return x * x; +} |