Skip to content

Commit 2d5bc57

Browse files
author
yngwe@scruffy
committed
CUDA 11.0 flag support
CUDA added a flag to enable unsupported compilers. The flag is always enabled, sincet he compiler gets tested during setup anyway.
1 parent ad5b30f commit 2d5bc57

File tree

1 file changed

+5
-3
lines changed
  • src/bugengine/3rdparty/compute/CUDA/mak

1 file changed

+5
-3
lines changed

src/bugengine/3rdparty/compute/CUDA/mak/setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def check_nvcc(configuration_context, nvcc):
5757
source_node.write(_CUDA_SNIPPET)
5858
out, err = run_nvcc(
5959
nvcc, configuration_context.env.NVCC_CXXFLAGS +
60-
['-v', source_node.abspath(), '-o',
61-
dest_node.abspath(), '-arch', 'compute_30']
60+
['-v', source_node.abspath(), '-o', dest_node.abspath()]
6261
)
6362
target_includes = None
6463
target_libs = None
@@ -97,6 +96,9 @@ def setup(configuration_context):
9796
cuda_available = False
9897
toolchain = configuration_context.env.TOOLCHAIN
9998
for version, compiler in configuration_context.env.NVCC_COMPILERS[::-1]:
99+
flags = []
100+
if version >= (11, ):
101+
flags.append('--allow-unsupported-compiler')
100102
version = '.'.join(str(x) for x in version)
101103
cuda_toolchain = toolchain + '-cuda{}'.format(version)
102104
configuration_context.setenv(cuda_toolchain, env=configuration_context.env.detach())
@@ -106,7 +108,7 @@ def setup(configuration_context):
106108
if v.MSVC_COMPILER:
107109
cxx_compiler = configuration_context.find_program('cl',
108110
path_list=configuration_context.env.MSVC_PATH)[0]
109-
v.append_value('NVCC_CXXFLAGS', ['--compiler-bindir', cxx_compiler])
111+
v.append_value('NVCC_CXXFLAGS', ['--compiler-bindir', cxx_compiler] + flags)
110112
if v.ARCH_LP64:
111113
v.append_value('NVCC_CXXFLAGS', ['-m64'])
112114
else:

0 commit comments

Comments
 (0)