summaryrefslogtreecommitdiff
path: root/sci-libs/rocWMMA/rocWMMA-5.7.1.ebuild
blob: a2ca2b3404dacc79a4c05ebc8bbca9d078192040 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
ROCM_SKIP_GLOBALS=1

inherit cmake rocm

DESCRIPTION="library for accelerating mixed precision matrix multiply-accumulate operations"
HOMEPAGE="https://github.com/ROCm/rocWMMA"
SRC_URI="https://github.com/ROCm/rocWMMA/archive/rocm-${PV}.tar.gz -> rocWMMA-${PV}.tar.gz"

LICENSE="MIT"
KEYWORDS="~amd64"
SLOT="0/$(ver_cut 1-2)"

DEPEND="=dev-util/hip-5*"

BDEPEND="
	test? (
		dev-cpp/gtest
	)
	dev-build/rocm-cmake
"

IUSE_TARGETS=( gfx908 gfx90a gfx1100 gfx1101 gfx1102 )
IUSE_TARGETS=( "${IUSE_TARGETS[@]/#/amdgpu_targets_}" )

IUSE="${IUSE_TARGETS[@]/#/+} test"

REQUIRED_USE="|| ( ${IUSE_TARGETS[*]} )"

RESTRICT="!test? ( test )"

S="${WORKDIR}/rocWMMA-rocm-${PV}"

PATCHES=(
	"${FILESDIR}"/${PN}-5.7.1-use-system-googletest.patch
)

src_configure() {
	local mycmakeargs=(
		-DCMAKE_SKIP_RPATH=ON
		-DAMDGPU_TARGETS="$(get_amdgpu_flags)"
		-DROCM_SYMLINK_LIBS=OFF
		-DROCWMMA_BUILD_SAMPLES=OFF
		-DROCWMMA_BUILD_TESTS=$(usex test ON OFF)
	)
	use test && mycmakeargs+=(-DROCWMMA_USE_SYSTEM_GOOGLETEST=ON)
	CC=hipcc CXX=hipcc cmake_src_configure
}

src_test() {
	check_amdgpu
	cmake_src_test -j1
}