| 1 |
project('cuda has header symbol', 'cuda') |
| 2 |
|
| 3 |
cuda = meson.get_compiler('cuda') |
| 4 |
|
| 5 |
# C checks |
| 6 |
assert (cuda.has_header_symbol('stdio.h', 'int'), 'base types should always be available') |
| 7 |
assert (cuda.has_header_symbol('stdio.h', 'printf'), 'printf function not found') |
| 8 |
assert (cuda.has_header_symbol('stdio.h', 'FILE'), 'FILE structure not found') |
| 9 |
assert (cuda.has_header_symbol('limits.h', 'INT_MAX'), 'INT_MAX define not found') |
| 10 |
assert (not cuda.has_header_symbol('limits.h', 'guint64'), 'guint64 is not defined in limits.h') |
| 11 |
assert (not cuda.has_header_symbol('stdlib.h', 'FILE'), 'FILE structure is defined in stdio.h, not stdlib.h') |
| 12 |
assert (not cuda.has_header_symbol('stdlol.h', 'printf'), 'stdlol.h shouldn\'t exist') |
| 13 |
assert (not cuda.has_header_symbol('stdlol.h', 'int'), 'shouldn\'t be able to find "int" with invalid header') |
| 14 |
|
| 15 |
# C++ checks |
| 16 |
assert (cuda.has_header_symbol('iostream', 'std::iostream'), 'iostream not found in iostream.h') |
| 17 |
assert (cuda.has_header_symbol('vector', 'std::vector'), 'vector not found in vector.h') |
| 18 |
assert (not cuda.has_header_symbol('limits.h', 'std::iostream'), 'iostream should not be defined in limits.h') |
| 19 |
|
| 20 |
# CUDA checks |
| 21 |
assert (cuda.has_header_symbol('cuda.h', 'CUDA_VERSION'), 'CUDA_VERSION not found in cuda.h') |
| 22 |
assert (not cuda.has_header_symbol('cuda.h', 'cublasSaxpy'), 'cublasSaxpy is defined in cublas.h, not cuda.h') |
| 23 |
if cuda.version().version_compare('>=4.0') |
| 24 |
assert (cuda.has_header_symbol('thrust/device_vector.h', 'thrust::device_vector'), 'thrust::device_vector not found') |
| 25 |
assert (not cuda.has_header_symbol('thrust/fill.h', 'thrust::sort'), 'thrust::sort should not be defined in thrust/fill.h') |
| 26 |
endif |