aboutsummaryrefslogtreecommitdiff
path: root/test cases/cuda
diff options
context:
space:
mode:
authorCarlos Bederian <carlos.bederian@unc.edu.ar>2020-10-15 23:35:39 -0300
committerDaniel Mensinger <daniel@mensinger-ka.de>2020-10-16 18:18:46 +0200
commit71be873be22d38d1b156b9811fea3ed01781dc55 (patch)
treebdbc4a0926af0a91e9c2267f917d7c7b2a9d4e71 /test cases/cuda
parentf09457a1e8878598eaf3862e1b759e53429b2528 (diff)
downloadmeson-71be873be22d38d1b156b9811fea3ed01781dc55.zip
meson-71be873be22d38d1b156b9811fea3ed01781dc55.tar.gz
meson-71be873be22d38d1b156b9811fea3ed01781dc55.tar.bz2
Add CUDA compiler header symbol tests
Diffstat (limited to 'test cases/cuda')
-rw-r--r--test cases/cuda/14 cuda has header symbol/meson.build27
1 files changed, 27 insertions, 0 deletions
diff --git a/test cases/cuda/14 cuda has header symbol/meson.build b/test cases/cuda/14 cuda has header symbol/meson.build
new file mode 100644
index 0000000..b29c52e
--- /dev/null
+++ b/test cases/cuda/14 cuda has header symbol/meson.build
@@ -0,0 +1,27 @@
+project('cuda has header symbol', 'cuda')
+
+cuda = meson.get_compiler('cuda')
+
+# C checks
+assert (cuda.has_header_symbol('stdio.h', 'int'), 'base types should always be available')
+assert (cuda.has_header_symbol('stdio.h', 'printf'), 'printf function not found')
+assert (cuda.has_header_symbol('stdio.h', 'FILE'), 'FILE structure not found')
+assert (cuda.has_header_symbol('limits.h', 'INT_MAX'), 'INT_MAX define not found')
+assert (not cuda.has_header_symbol('limits.h', 'guint64'), 'guint64 is not defined in limits.h')
+assert (not cuda.has_header_symbol('stdlib.h', 'FILE'), 'FILE structure is defined in stdio.h, not stdlib.h')
+assert (not cuda.has_header_symbol('stdlol.h', 'printf'), 'stdlol.h shouldn\'t exist')
+assert (not cuda.has_header_symbol('stdlol.h', 'int'), 'shouldn\'t be able to find "int" with invalid header')
+
+# C++ checks
+assert (cuda.has_header_symbol('iostream', 'std::iostream'), 'iostream not found in iostream.h')
+assert (cuda.has_header_symbol('vector', 'std::vector'), 'vector not found in vector.h')
+assert (not cuda.has_header_symbol('limits.h', 'std::iostream'), 'iostream should not be defined in limits.h')
+
+# CUDA checks
+assert (cuda.has_header_symbol('cuda.h', 'CUDA_VERSION'), 'CUDA_VERSION not found in cuda.h')
+assert (not cuda.has_header_symbol('cuda.h', 'cublasSaxpy'), 'cublasSaxpy is defined in cublas.h, not cuda.h')
+if cuda.version().version_compare('>=4.0')
+ assert (cuda.has_header_symbol('thrust/device_vector.h', 'thrust::device_vector'), 'thrust::device_vector not found')
+ assert (not cuda.has_header_symbol('thrust/fill.h', 'thrust::sort'), 'thrust::sort should not be defined in thrust/fill.h')
+endif
+