Skip to content

Commit 0508c19

Browse files
committed
Fix tuple index access
1 parent f298963 commit 0508c19

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

eb_hooks.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,23 +1946,25 @@ def find_rocm_llvm_dependency(ec):
19461946
toolchain is rompi/rfbf/rfoss.
19471947
"""
19481948
for dep in ec.asdict()['dependencies']:
1949-
if dep['name'] == 'ROCm-LLVM':
1949+
if dep[0] == 'ROCm-LLVM':
19501950
return dep
19511951

1952-
if is_system_toolchain(ec.toolchain.name):
1952+
# Only inspect the toolchain for ROCm toolchains.
1953+
if ec['toolchain']['name'] not in ('rocm-compilers', 'rompi', 'rfbf', 'rfoss'):
19531954
return None
19541955

19551956
tcdeps = ec.toolchain.tcdeps or []
19561957
for dep in tcdeps:
1957-
if dep['name'] == 'ROCm-LLVM':
1958+
if dep[0] == 'ROCm-LLVM':
19581959
return dep
19591960
for dep in tcdeps:
1960-
if dep['name'] == 'rocm-compilers':
1961-
rocm_compilers_ec = robot_find_easyconfig(dep['name'], dep['version'] + dep['versionsuffix'])
1961+
if dep[0] == 'rocm-compilers':
1962+
versionsuffix = dep[2] if len(dep) > 2 else ''
1963+
rocm_compilers_ec = robot_find_easyconfig(dep[0], dep[1] + versionsuffix)
19621964
if rocm_compilers_ec:
19631965
rocm_compilers_deps = process_easyconfig(rocm_compilers_ec)[0]['ec'].dependencies(runtime_only=True)
19641966
for subdep in rocm_compilers_deps:
1965-
if subdep['name'] == 'ROCm-LLVM':
1967+
if subdep[0] == 'ROCm-LLVM':
19661968
return subdep
19671969

19681970
return None
@@ -2000,7 +2002,8 @@ def inject_gpu_property(ec):
20002002
rocm_llvm_dep = find_rocm_llvm_dependency(ec)
20012003
if rocm_llvm_dep is not None:
20022004
add_gpu_property = 'add_property("arch","gpu")'
2003-
pkg_versions['ROCm-LLVM'] = rocm_llvm_dep['version'] + (rocm_llvm_dep['versionsuffix'] or '')
2005+
versionsuffix = rocm_llvm_dep[2] if len(rocm_llvm_dep) > 2 else ''
2006+
pkg_versions['ROCm-LLVM'] = rocm_llvm_dep[1] + versionsuffix
20042007

20052008
if add_gpu_property:
20062009
ec.log.info("Injecting gpu as Lmod arch property and envvars for dependencies with their version")

0 commit comments

Comments
 (0)