summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly/WithDefs
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CudaOnly/WithDefs')
-rw-r--r--Tests/CudaOnly/WithDefs/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/WithDefs/main.notcu12
2 files changed, 14 insertions, 0 deletions
diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt
index 9b82366..5bd93a4 100644
--- a/Tests/CudaOnly/WithDefs/CMakeLists.txt
+++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt
@@ -32,6 +32,8 @@ add_executable(CudaOnlyWithDefs ${main})
target_compile_options(CudaOnlyWithDefs
PRIVATE
+ -DCOMPILE_LANG_$<COMPILE_LANGUAGE>
+ -DLANG_IS_CUDA=$<COMPILE_LANGUAGE:CUDA>
-Xcompiler=-DHOST_DEFINE
$<$<CONFIG:DEBUG>:$<BUILD_INTERFACE:${debug_compile_flags}>>
)
diff --git a/Tests/CudaOnly/WithDefs/main.notcu b/Tests/CudaOnly/WithDefs/main.notcu
index d2eff3f..bfb3577 100644
--- a/Tests/CudaOnly/WithDefs/main.notcu
+++ b/Tests/CudaOnly/WithDefs/main.notcu
@@ -10,6 +10,18 @@
#error "PACKED_DEFINE not defined!"
#endif
+#ifndef COMPILE_LANG_CUDA
+#error "COMPILE_LANG_CUDA not defined!"
+#endif
+
+#ifndef LANG_IS_CUDA
+#error "LANG_IS_CUDA not defined!"
+#endif
+
+#if !LANG_IS_CUDA
+#error "Expected LANG_IS_CUDA"
+#endif
+
static __global__ void DetermineIfValidCudaDevice()
{
}