Allow PyTorch to forward gcc-toolchain cxxcflag to CUDA toolchains (#30318)
This commit is contained in:
parent
c4ad003af2
commit
06e7249850
1 changed files with 4 additions and 0 deletions
|
@ -301,6 +301,10 @@ def enable_or_disable(variant, keyword='USE', var=None, newer=False):
|
||||||
in
|
in
|
||||||
self.spec.variants['cuda_arch'].value)
|
self.spec.variants['cuda_arch'].value)
|
||||||
env.set('TORCH_CUDA_ARCH_LIST', torch_cuda_arch)
|
env.set('TORCH_CUDA_ARCH_LIST', torch_cuda_arch)
|
||||||
|
if self.spec.satisfies('%clang'):
|
||||||
|
for flag in self.spec.compiler_flags['cxxflags']:
|
||||||
|
if 'gcc-toolchain' in flag:
|
||||||
|
env.set('CMAKE_CUDA_FLAGS', '=-Xcompiler={0}'.format(flag))
|
||||||
|
|
||||||
enable_or_disable('rocm')
|
enable_or_disable('rocm')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue