diff options
author | Alfredo Tupone <tupone@gentoo.org> | 2022-05-17 14:40:45 +0200 |
---|---|---|
committer | Alfredo Tupone <tupone@gentoo.org> | 2022-05-17 14:40:45 +0200 |
commit | e7664d69374ed92bde56cf31acd659474d92d080 (patch) | |
tree | 42118f8094a3d09202736a4584dece9835cc372a /sci-libs/XNNPACK | |
parent | media-video/mpv: x86 stable wrt bug #843758 (diff) | |
download | gentoo-e7664d69374ed92bde56cf31acd659474d92d080.tar.gz gentoo-e7664d69374ed92bde56cf31acd659474d92d080.tar.bz2 gentoo-e7664d69374ed92bde56cf31acd659474d92d080.zip |
sci-libs/XNNPACK: add to tree
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'sci-libs/XNNPACK')
-rw-r--r-- | sci-libs/XNNPACK/Manifest | 1 | ||||
-rw-r--r-- | sci-libs/XNNPACK/XNNPACK-2022.02.17.ebuild | 81 | ||||
-rw-r--r-- | sci-libs/XNNPACK/files/XNNPACK-2022.02.17-gentoo.patch | 12 | ||||
-rw-r--r-- | sci-libs/XNNPACK/metadata.xml | 17 |
4 files changed, 111 insertions, 0 deletions
diff --git a/sci-libs/XNNPACK/Manifest b/sci-libs/XNNPACK/Manifest new file mode 100644 index 000000000000..60b8d1d259f6 --- /dev/null +++ b/sci-libs/XNNPACK/Manifest @@ -0,0 +1 @@ +DIST XNNPACK-2022.02.17.tar.gz 6761154 BLAKE2B 59be5d9efe6f46d22bc41d3152e6cd3103f6dfafd94cdf3229b86ecf44a46175c613760f3de35c98a24ccdec1783f205c1eceaf21133706fedd5f384529748eb SHA512 aacbe907bb2b7429143f4ec612881fb709fe37e7b3a7f4fd68193dee6bbe82e17d20b2c6f5a8025845a09f8269c1dfeaebfc5bd64ef196fa376d82ac9a44cb8f diff --git a/sci-libs/XNNPACK/XNNPACK-2022.02.17.ebuild b/sci-libs/XNNPACK/XNNPACK-2022.02.17.ebuild new file mode 100644 index 000000000000..c4bb3f365e75 --- /dev/null +++ b/sci-libs/XNNPACK/XNNPACK-2022.02.17.ebuild @@ -0,0 +1,81 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +inherit cmake + +CommitId=84b02ad55f089598aa42a557573dc4eb6f92f3ff + +DESCRIPTION="library of floating-point neural network inference operators" +HOMEPAGE="https://github.com/google/XNNPACK/" +SRC_URI="https://github.com/google/${PN}/archive/${CommitId}.tar.gz + -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="+assembly jit +memopt +sparse static-libs test" + +DEPEND=" + dev-libs/FP16 + dev-libs/FXdiv +" +RDEPEND="${DEPEND} + dev-libs/cpuinfo + dev-libs/pthreadpool +" +BDEPEND="test? ( dev-cpp/gtest )" +RESTRICT="!test? ( test )" +REQUIRED_USE="test? ( static-libs )" + +S="${WORKDIR}"/${PN}-${CommitId} + +PATCHES=( + "${FILESDIR}"/${P}-gentoo.patch +) + +src_prepare() { + sed -i \ + -e "/PRIVATE fp16)/d" \ + -e "/PRIVATE fxdiv)/d" \ + -e "/PRIVATE clog)/d" \ + -e "/TARGET_LINK_LIBRARIES/s: fp16::" \ + CMakeLists.txt \ + || die + dropTest=( + "add-nd-test" + "subtract-nd-test" + "f32-velu-test" + "qc8-dwconv-minmax-fp32-test" + "qs8-dwconv-minmax-fp32-test" + "qs8-vadd-minmax-test" + "qs8-vaddc-minmax-test" + "qu8-dwconv-minmax-fp32-test" + "qu8-vadd-minmax-test" + "qu8-vaddc-minmax-test" + ) + for id in ${dropTest[@]} + do + sed -i \ + -e "/ADD_TEST(${id}/d" \ + CMakeLists.txt \ + || die + done + + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DXNNPACK_BUILD_BENCHMARKS=OFF + -DXNNPACK_USE_SYSTEM_LIBS=ON + -DXNNPACK_BUILD_TESTS=$(usex test ON OFF) + -DXNNPACK_LIBRARY_TYPE=$(usex static-libs static shared) + -DXNNPACK_ENABLE_ASSEMBLY=$(usex assembly ON OFF) + -DXNNPACK_ENABLE_JIT=$(usex jit ON OFF) + -DXNNPACK_ENABLE_MEMOPT=$(usex memopt ON OFF) + -DXNNPACK_ENABLE_SPARSE=$(usex sparse ON OFF) + ) + + cmake_src_configure +} diff --git a/sci-libs/XNNPACK/files/XNNPACK-2022.02.17-gentoo.patch b/sci-libs/XNNPACK/files/XNNPACK-2022.02.17-gentoo.patch new file mode 100644 index 000000000000..f07ba08edf56 --- /dev/null +++ b/sci-libs/XNNPACK/files/XNNPACK-2022.02.17-gentoo.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt 2022-05-10 08:26:00.636788471 +0200 ++++ b/CMakeLists.txt 2022-05-10 08:26:57.097938381 +0200 +@@ -6696,9 +6696,6 @@ + # ---[ Build google test + IF(NOT TARGET gtest) + SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +- ADD_SUBDIRECTORY( +- "${GOOGLETEST_SOURCE_DIR}" +- "${CMAKE_BINARY_DIR}/googletest") + ENDIF() + + ADD_LIBRARY(gemm-microkernel-tester STATIC test/gemm-microkernel-tester.cc) diff --git a/sci-libs/XNNPACK/metadata.xml b/sci-libs/XNNPACK/metadata.xml new file mode 100644 index 000000000000..ddf909e2c6ee --- /dev/null +++ b/sci-libs/XNNPACK/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>tupone@gentoo.org</email> + <name>Tupone Alfredo</name> + </maintainer> + <use> + <flag name="assembly">Build with assembly micro-kernels</flag> + <flag name="jit">Build with JIT micro-kernels</flag> + <flag name="memopt">Build with optimized memory allocation scheme</flag> + <flag name="sparse">Build with graph rewriting for sparse inference</flag> + </use> + <upstream> + <remote-id type="github">google/XNNPACK</remote-id> + </upstream> +</pkgmetadata> |