blob: c3abc30b8af8ba9c5c2b20808a86c21ed8a558c1 (
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
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# Copyright 2022-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
inherit cmake python-single-r1
CommitId=c07e3a0400713d546e0dea2d5466dd22ea389c73
DESCRIPTION="acceleration package for neural network computations"
HOMEPAGE="https://github.com/Maratyszcza/NNPACK/"
SRC_URI="https://github.com/Maratyszcza/${PN}/archive/${CommitId}.tar.gz
-> ${P}.tar.gz"
S="${WORKDIR}"/${PN}-${CommitId}
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test test-full"
RESTRICT="!test? ( test )"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RDEPEND="
${PYTHON_DEPS}
dev-libs/pthreadpool
dev-libs/cpuinfo
$(python_gen_cond_dep '
<=sci-ml/FP16-2024.05.27[${PYTHON_USEDEP}]
dev-python/peachpy[${PYTHON_USEDEP}]
')
"
DEPEND="${RDEPEND}
dev-libs/FXdiv
dev-libs/psimd
"
BDEPEND="
${RDEPEND}
test? ( dev-cpp/gtest )
"
PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
src_prepare() {
sed -i \
-e "/-O/d" \
-e "s:CXX_STANDARD 11:CXX_STANDARD 14:" \
CMakeLists.txt || die
cmake_src_prepare
}
src_configure() {
local mycmakeargs=(
-DNNPACK_BUILD_TESTS=$(usex test ON OFF)
)
cmake_src_configure
}
src_test() {
use test-full || local CMAKE_SKIP_TESTS=(
convolution-output-overfeat
convolution-kernel-gradient-vgg
convolution-input-gradient-overfeat
convolution-input-gradient-vgg
convolution-output-vgg
)
cmake_src_test
}
|