HIPFORT_GPU=$(rocm_agent_enumerator | sort -n | uniq | sed '/gfx000/d')
IMO the above fix will not solve the issue in scenarios where a node is equipped with two or more GPUs of differing architectures. This is not common but might be the case for some test systems.
That case was handled by the other change:
for arch in "$HIPFORT_GPU" ; do
HIPCC_OPTS+=" --offload-arch=$arch "
done
That case was handled by the other change: