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 EA1E6158013 for ; Thu, 14 Dec 2023 15:02:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A09602BC029; Thu, 14 Dec 2023 15:02:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 852732BC029 for ; Thu, 14 Dec 2023 15:02:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 smtp.gentoo.org (Postfix) with ESMTPS id B732433CEF2 for ; Thu, 14 Dec 2023 15:02:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E2197123C for ; Thu, 14 Dec 2023 15:02:20 +0000 (UTC) From: "Benda XU" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Benda XU" Message-ID: <1702565464.76dc598ae5a2f447f3b9d9e69fb1499b5631c926.heroxbd@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/rocm.eclass X-VCS-Directories: eclass/ X-VCS-Committer: heroxbd X-VCS-Committer-Name: Benda XU X-VCS-Revision: 76dc598ae5a2f447f3b9d9e69fb1499b5631c926 X-VCS-Branch: master Date: Thu, 14 Dec 2023 15:02:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4b980157-5bd5-4a8b-ada8-1b3caf0b8f51 X-Archives-Hash: 2fafa245cbfe2de7b6c4ac84e06a03ed commit: 76dc598ae5a2f447f3b9d9e69fb1499b5631c926 Author: Benda Xu gentoo org> AuthorDate: Sun Nov 19 06:46:10 2023 +0000 Commit: Benda XU gentoo org> CommitDate: Thu Dec 14 14:51:04 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76dc598a rocm.eclass: add ROCM_SKIP_GLOBALS for the USE-flags exposure. 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 gentoo.org> 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: