summaryrefslogtreecommitdiffstats
path: root/Tests/Cuda/ProperDeviceLibraries/use_pthreads.cu
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2018-10-22 14:54:44 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-24 14:15:48 (GMT)
commit2cc050b53b4afb1ed62621360b860e25b7c46015 (patch)
treec2446498b1c4db63138987a8d62390c5c1478e34 /Tests/Cuda/ProperDeviceLibraries/use_pthreads.cu
parent83c13ca44f661ba22acf4abe63d84fd5651b4dbc (diff)
downloadCMake-2cc050b53b4afb1ed62621360b860e25b7c46015.zip
CMake-2cc050b53b4afb1ed62621360b860e25b7c46015.tar.gz
CMake-2cc050b53b4afb1ed62621360b860e25b7c46015.tar.bz2
CUDA: Add test for device linking when host linking uses threads
Convert the `CudaOnly.LinkSystemDeviceLibraries` test to a new `Cuda.ProperDeviceLibraries` test. The former covered only the `cublas_device` library which is removed by CUDA 10. Extend the new test to also cover various cases of using threads. Issue: #18008
Diffstat (limited to 'Tests/Cuda/ProperDeviceLibraries/use_pthreads.cu')
-rw-r--r--Tests/Cuda/ProperDeviceLibraries/use_pthreads.cu9
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/Cuda/ProperDeviceLibraries/use_pthreads.cu b/Tests/Cuda/ProperDeviceLibraries/use_pthreads.cu
new file mode 100644
index 0000000..c57b8a8
--- /dev/null
+++ b/Tests/Cuda/ProperDeviceLibraries/use_pthreads.cu
@@ -0,0 +1,9 @@
+
+#if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)
+
+# include <pthread.h>
+static int verify_linking_to_pthread_cuda()
+{
+ return static_cast<int>(pthread_self());
+}
+#endif