summaryrefslogtreecommitdiffstats
path: root/Tests/Cuda/ObjectLibrary/Conflicts
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2018-01-18 21:05:59 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2018-01-30 14:14:02 (GMT)
commitfa583869f7e75cdc4c7499f0dbfab2cdac5061bd (patch)
tree325e7e091628ed0e901a800d2ceb5f99cf7a299a /Tests/Cuda/ObjectLibrary/Conflicts
parent142938225e572d846c956f9b1f54d24a960379ab (diff)
downloadCMake-fa583869f7e75cdc4c7499f0dbfab2cdac5061bd.zip
CMake-fa583869f7e75cdc4c7499f0dbfab2cdac5061bd.tar.gz
CMake-fa583869f7e75cdc4c7499f0dbfab2cdac5061bd.tar.bz2
CUDA: Use MSVC default pattern for naming object files
The default that CUDA uses causes failures when you try to embed CUDA obj's into another target.
Diffstat (limited to 'Tests/Cuda/ObjectLibrary/Conflicts')
-rw-r--r--Tests/Cuda/ObjectLibrary/Conflicts/CMakeLists.txt2
-rw-r--r--Tests/Cuda/ObjectLibrary/Conflicts/static.cu17
2 files changed, 19 insertions, 0 deletions
diff --git a/Tests/Cuda/ObjectLibrary/Conflicts/CMakeLists.txt b/Tests/Cuda/ObjectLibrary/Conflicts/CMakeLists.txt
new file mode 100644
index 0000000..1602f8a
--- /dev/null
+++ b/Tests/Cuda/ObjectLibrary/Conflicts/CMakeLists.txt
@@ -0,0 +1,2 @@
+
+add_library(CudaConflicts OBJECT static.cu)
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;
+}