Skip to content

Commit 07321e7

Browse files
committed
make nvcc_gencode an array of flags
1 parent 0bc6672 commit 07321e7

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

meson.build

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,9 @@ if cuda_dep.found()
6767
cuda = import('unstable-cuda')
6868
nvcc = meson.get_compiler('cuda')
6969

70-
nvcc_flags = []
71-
nvcc_flags_link = []
72-
if get_option('nvcc_gencode') != ''
73-
foreach p : get_option('nvcc_gencode').split(' ')
74-
nvcc_flags += p
75-
nvcc_flags_link += p
76-
endforeach
77-
endif
70+
nvcc_flags = get_option('nvcc_gencode')
7871
add_project_arguments(nvcc_flags, language: 'cuda')
79-
add_project_link_arguments(nvcc_flags_link, language: 'cuda')
72+
add_project_link_arguments(nvcc_flags, language: 'cuda')
8073

8174
# Refer to https://mesonbuild.com/Cuda-module.html
8275
add_project_arguments('-forward-unknown-to-host-compiler', language: 'cuda')

meson_options.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ option('gds_path', type: 'string', value: '/usr/local/cuda/', description: 'Path
2323
option('cudapath_inc', type: 'string', value: '', description: 'Include path for CUDA')
2424
option('cudapath_lib', type: 'string', value: '', description: 'Library path for CUDA')
2525
option('cudapath_stub', type: 'string', value: '', description: 'Extra Stub path for CUDA')
26-
option('nvcc_gencode', type: 'string', value: '-gencode=arch=compute_80,code=sm_80 -gencode=arch=compute_90,code=sm_90',
27-
description: 'NVCC GPU architectures to target (space-separated -gencode flags)')
26+
option('nvcc_gencode',
27+
type : 'array',
28+
value : [
29+
'-gencode=arch=compute_80,code=sm_80',
30+
'-gencode=arch=compute_90,code=sm_90',
31+
],
32+
description : 'NVCC GPU architectures to target (list of -gencode flags)')
2833
option('static_plugins', type: 'string', value: '', description: 'Plugins to be built-in, comma-separated')
2934
option('build_docs', type: 'boolean', value: false, description: 'Build Doxygen documentation')
3035
option('log_level', type: 'combo', choices: ['trace', 'debug', 'info', 'warning', 'error', 'fatal', 'auto'], value: 'auto', description: 'Log Level (auto: auto-detect based on build type: trace for debug builds, info for release builds)')

0 commit comments

Comments
 (0)