Skip to content

Commit

Permalink
rocm.eclass: add ROCM_SKIP_GLOBALS for the USE-flags exposure.
Browse files Browse the repository at this point in the history
Low level ebuilds such as dev-util/hip and
dev-libs/rocm-opencl-runtime unconditionally supports all the AMDGPU
cards. They do not need to define amdgpu_targets_* USE-flags.  But
their src_test() call check_amdgpu() to confirm an AMDGPU is
available.

Reference: https://marc.info/?l=gentoo-dev&m=170045497732286
Signed-off-by: Benda Xu <[email protected]>
  • Loading branch information
heroxbd committed Dec 14, 2023
1 parent 2f762d4 commit 76dc598
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions eclass/rocm.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,26 @@ _ROCM_ECLASS=1
# DEPEND="sci-libs/rocBLAS[${ROCM_USEDEP}]"
# @CODE

# @ECLASS_VARIABLE: ROCM_SKIP_GLOBALS
# @DESCRIPTION:
# Controls whether _rocm_set_globals() is executed. This variable is for
# ebuilds that call check_amdgpu() without the need to define amdgpu_targets_*
# USE-flags, such as dev-util/hip and dev-libs/rocm-opencl-runtime.
#
# Example use:
# @CODE
# ROCM_SKIP_GLOBALS=1
# inherit rocm
# @CODE

# @FUNCTION: _rocm_set_globals
# @DESCRIPTION:
# Set global variables useful to ebuilds: IUSE, ROCM_REQUIRED_USE, and
# ROCM_USEDEP
# ROCM_USEDEP, unless ROCM_SKIP_GLOBALS is set.

_rocm_set_globals() {
[[ -n ${ROCM_SKIP_GLOBALS} ]] && return

# Two lists of AMDGPU_TARGETS of certain ROCm version. Official support
# matrix:
# https://docs.amd.com/bundle/ROCm-Installation-Guide-v${ROCM_VERSION}/page/Prerequisite_Actions.html.
Expand Down Expand Up @@ -179,7 +194,6 @@ _rocm_set_globals() {
_rocm_set_globals
unset -f _rocm_set_globals


# @FUNCTION: get_amdgpu_flags
# @USAGE: get_amdgpu_flags
# @DESCRIPTION:
Expand Down

0 comments on commit 76dc598

Please sign in to comment.