From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0A6CA158099 for ; Mon, 27 Nov 2023 00:48:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DFE812BC05B; Mon, 27 Nov 2023 00:48:07 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 73DCB2BC013 for ; Mon, 27 Nov 2023 00:48:07 +0000 (UTC) Received: from [2a0c:b641:69c:e781:f::2] (port=50718 helo=quark.does.not.exist) by muon.airelinux.org with esmtp (Exim 4.96) (envelope-from ) id 1r7Pn9-0002kQ-1O; Mon, 27 Nov 2023 00:48:03 +0000 From: heroxbd@gentoo.org To: gentoo-dev@lists.gentoo.org Cc: Benda Xu Subject: [gentoo-dev] [PATCH] rocm.eclass: add ROCM_SKIP_GLOBALS for the USE-flags exposure. Date: Mon, 27 Nov 2023 08:47:35 +0800 Message-ID: <20231127004752.174404-1-heroxbd@gentoo.org> X-Mailer: git-send-email 2.41.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 15f2696d-cb8a-4655-a651-13032edb2526 X-Archives-Hash: 61935d35b7a27cc26741342d7eb6cb5e From: Benda Xu 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. Signed-off-by: Benda Xu --- eclass/rocm.eclass | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/eclass/rocm.eclass b/eclass/rocm.eclass index b78dfea1cc31..9804ecde97d0 100644 --- a/eclass/rocm.eclass +++ b/eclass/rocm.eclass @@ -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. @@ -179,7 +194,6 @@ _rocm_set_globals() { _rocm_set_globals unset -f _rocm_set_globals - # @FUNCTION: get_amdgpu_flags # @USAGE: get_amdgpu_flags # @DESCRIPTION: -- 2.41.0