Fix ZFP cuda build. (#23941)

This commit is contained in:
Ben Corbett 2021-05-27 20:46:19 -07:00 committed by GitHub
parent 850cac5ea3
commit 429b71bf57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,13 +93,21 @@ def cmake_args(self):
self.define_from_variant('BUILD_CFP', 'c'),
self.define_from_variant('BUILD_ZFPY', 'python'),
self.define_from_variant('BUILD_ZFORP', 'fortran'),
self.define_from_variant('ZFP_WITH_CUDA', 'cuda'),
self.define('ZFP_BIT_STREAM_WORD_SIZE',
spec.variants['bsws'].value),
self.define_from_variant('ZFP_WITH_BIT_STREAM_STRIDED', 'strided'),
self.define_from_variant('ZFP_WITH_ALIGNED_ALLOC', 'aligned'),
self.define_from_variant('ZFP_WITH_CACHE_TWOWAY', 'twoway'),
self.define_from_variant('ZFP_WITH_CACHE_FAST_HASH', 'fasthash'),
self.define_from_variant('ZFP_WITH_CACHE_PROFILE', 'profile')
self.define_from_variant('ZFP_WITH_CACHE_PROFILE', 'profile'),
]
if '+cuda' in spec:
args.append('-DCUDA_BIN_DIR={0}'.format(spec['cuda'].prefix.bin))
if not spec.satisfies('cuda_arch=none'):
cuda_arch = spec.variants['cuda_arch'].value
args.append('-DCMAKE_CUDA_FLAGS=-arch sm_{0}'.format(cuda_arch[0]))
return args