summaryrefslogtreecommitdiff
path: root/Tests/Cuda/MixedStandardLevels1
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-11-01 08:12:05 -0400
committerRobert Maynard <robert.maynard@kitware.com>2019-12-10 17:56:48 -0500
commit2467a2b3184595a87e93db510408fc14ddbaf3b9 (patch)
tree37e35f4a3c821634cc18c6cd8df8acf2391d4f5c /Tests/Cuda/MixedStandardLevels1
parentf62c674202045f877eaed9da0f9cbe2046452b40 (diff)
downloadcmake-2467a2b3184595a87e93db510408fc14ddbaf3b9.tar.gz
CUDA: Add cuda meta-features (e.g. ``cuda_std_11``) support
Diffstat (limited to 'Tests/Cuda/MixedStandardLevels1')
-rw-r--r--Tests/Cuda/MixedStandardLevels1/CMakeLists.txt14
-rw-r--r--Tests/Cuda/MixedStandardLevels1/lib.cpp7
-rw-r--r--Tests/Cuda/MixedStandardLevels1/main.cu9
3 files changed, 30 insertions, 0 deletions
diff --git a/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt
new file mode 100644
index 0000000000..b03e51e3e2
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.7)
+project(MixedStandardLevels1 CXX CUDA)
+
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CUDA_STANDARD 11)
+
+add_executable(MixedStandardLevels1 main.cu lib.cpp)
+
+if(APPLE)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET MixedStandardLevels1 PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+endif()
diff --git a/Tests/Cuda/MixedStandardLevels1/lib.cpp b/Tests/Cuda/MixedStandardLevels1/lib.cpp
new file mode 100644
index 0000000000..cabbacb085
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels1/lib.cpp
@@ -0,0 +1,7 @@
+
+int func(int A, int B)
+{
+ // Verify that we have at least c++14
+ auto mult_func = [](auto a, auto b) { return a * b; };
+ return mult_func(A, B);
+}
diff --git a/Tests/Cuda/MixedStandardLevels1/main.cu b/Tests/Cuda/MixedStandardLevels1/main.cu
new file mode 100644
index 0000000000..bc02c6d10d
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels1/main.cu
@@ -0,0 +1,9 @@
+
+#include <type_traits>
+
+int main(int argc, char** argv)
+{
+ // Verify that we have at least c++11
+ using returnv = std::integral_constant<int, 0>;
+ return returnv::value;
+}