enable the variant AMDGPU_TARGETS in rocsolver (#25423)

This commit is contained in:
Sreenivasa Murthy Kolam 2021-08-16 04:06:09 -07:00 committed by GitHub
parent 5f50f3329f
commit 2d047d1f51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,11 @@ class Rocsolver(CMakePackage):
maintainers = ['srekolam', 'arjun-raj-kuppala', 'haampie']
amdgpu_targets = (
'none', 'gfx803', 'gfx900', 'gfx906:xnack-', 'gfx908:xnack-',
'gfx90a:xnack-', 'gfx90a:xnack+', 'gfx1010', 'gfx1011', 'gfx1012', 'gfx1030'
)
variant('amdgpu_target', default='gfx906:xnack-', multi=True, values=amdgpu_targets)
variant('optimal', default=True,
description='This option improves performance at the cost of increased binary \
size and compile time by adding specialized kernels \
@ -46,6 +51,7 @@ class Rocsolver(CMakePackage):
depends_on('rocm-cmake@' + ver, type='build', when='@' + ver)
def cmake_args(self):
tgt = self.spec.variants['amdgpu_target'].value
args = [
self.define('BUILD_CLIENTS_SAMPLES', 'OFF'),
self.define('BUILD_CLIENTS_TESTS', 'OFF'),
@ -61,6 +67,13 @@ def cmake_args(self):
if self.spec.satisfies('@3.7.0:'):
args.append(self.define_from_variant('OPTIMAL', 'optimal'))
if tgt[0] != 'none':
if '@:3.8.0' in self.spec:
args.append(self.define('CMAKE_CXX_FLAGS',
'--amdgpu-target={0}'.format(",".join(tgt))))
else:
args.append(self.define('AMDGPU_TARGETS', ";".join(tgt)))
if self.spec.satisfies('^cmake@3.21:'):
args.append(self.define('__skip_rocmclang', 'ON'))