summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSv. Lockal <lockalsash@gmail.com>2024-01-08 21:02:34 +0000
committerAlfredo Tupone <tupone@gentoo.org>2024-01-09 08:15:27 +0100
commit9e21013daa5aecab18faf0159e661b529a8de2af (patch)
tree77f9b98a1ab3a63b1ca4358a76e0d50db5d4bc7a
parentdev-libs/pthreadpool: add 2023.08.29 (diff)
downloadgentoo-9e21013daa5aecab18faf0159e661b529a8de2af.tar.gz
gentoo-9e21013daa5aecab18faf0159e661b529a8de2af.tar.bz2
gentoo-9e21013daa5aecab18faf0159e661b529a8de2af.zip
dev-libs/oneDNN: new package, add 3.3.3
Signed-off-by: Sv. Lockal <lockalsash@gmail.com> Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
-rw-r--r--dev-libs/oneDNN/Manifest1
-rw-r--r--dev-libs/oneDNN/metadata.xml24
-rw-r--r--dev-libs/oneDNN/oneDNN-3.3.3.ebuild106
-rw-r--r--profiles/features/musl/package.use.mask3
4 files changed, 133 insertions, 1 deletions
diff --git a/dev-libs/oneDNN/Manifest b/dev-libs/oneDNN/Manifest
new file mode 100644
index 000000000000..72537adf9cba
--- /dev/null
+++ b/dev-libs/oneDNN/Manifest
@@ -0,0 +1 @@
+DIST oneDNN-3.3.3.tar.gz 11577369 BLAKE2B 85df74235d70d30d69ebb1702dcb328466d38046b37f4078b1d6880c7cbe079d095e53e5c9e2f0f77daca057cae62e661ac1bf919e8f128cf9c76a847dc0425d SHA512 bb4a6b33b3191b9e517a321dd089b7debb528dd2d4be48f52626308fe0e1dbea3fa6149fd9debe6aa23f11224ac80e4d3ee1e251d2007faf9bcc262bb895de71
diff --git a/dev-libs/oneDNN/metadata.xml b/dev-libs/oneDNN/metadata.xml
new file mode 100644
index 000000000000..1e6efe71ca6a
--- /dev/null
+++ b/dev-libs/oneDNN/metadata.xml
@@ -0,0 +1,24 @@
+<?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>
+ <maintainer type="person">
+ <email>lockalsash@gmail.com</email>
+ <name>Sv. Lockal</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <bugs-to>https://github.com/oneapi-src/oneDNN/issues</bugs-to>
+ <remote-id type="github">oneapi-src/oneDNN</remote-id>
+ </upstream>
+ <use>
+ <flag name="mkl">Use sci-libs/mkl for sgemm routines</flag>
+ <flag name="cblas">Use virtual/cblas for sgemm routines</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-libs/oneDNN/oneDNN-3.3.3.ebuild b/dev-libs/oneDNN/oneDNN-3.3.3.ebuild
new file mode 100644
index 000000000000..88b11ae05e38
--- /dev/null
+++ b/dev-libs/oneDNN/oneDNN-3.3.3.ebuild
@@ -0,0 +1,106 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DOCS_BUILDER="doxygen"
+DOCS_DIR="${WORKDIR}/${P}_build"
+
+# oneDNN has its own FindBLAS.cmake file to find MKL (in a non-standard way).
+# Removing of CMake modules is disabled.
+CMAKE_REMOVE_MODULES_LIST=( none )
+
+# There is additional sphinx documentation but we are missing dependency doxyrest.
+inherit cmake docs
+
+DESCRIPTION="oneAPI Deep Neural Network Library"
+HOMEPAGE="https://github.com/oneapi-src/oneDNN"
+SRC_URI="https://github.com/oneapi-src/oneDNN/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+IUSE="test cpu_flags_x86_avx512f cpu_flags_x86_avx2 cpu_flags_x86_sse4_1 mkl cblas static-libs"
+
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ mkl? ( sci-libs/mkl )
+ cblas? ( !mkl? ( virtual/cblas ) )
+"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ local mycmakeargs=(
+ -DDNNL_LIBRARY_TYPE=$(usex static-libs STATIC SHARED)
+ -DDNNL_CPU_RUNTIME=OMP
+ -DDNNL_GPU_RUNTIME=NONE
+ -DDNNL_BUILD_EXAMPLES=OFF
+ -DDNNL_BUILD_TESTS="$(usex test)"
+ -DDNNL_ENABLE_CONCURRENT_EXEC=OFF
+ -DDNNL_ENABLE_JIT_PROFILING=ON
+ -DDNNL_ENABLE_ITT_TASKS=ON
+ -DDNNL_ENABLE_PRIMITIVE_CACHE=ON
+ -DDNNL_ENABLE_MAX_CPU_ISA=ON
+ -DDNNL_ENABLE_CPU_ISA_HINTS=ON
+ -DDNNL_ENABLE_WORKLOAD=TRAINING
+ -DDNNL_ENABLE_PRIMITIVE=ALL
+ -DDNNL_ENABLE_PRIMITIVE_GPU_ISA=ALL
+ -DDNNL_EXPERIMENTAL=OFF
+ -DDNNL_VERBOSE=ON
+ -DDNNL_DEV_MODE=OFF
+ -DDNNL_AARCH64_USE_ACL=OFF
+ -DDNNL_GPU_VENDOR=INTEL
+ -DDNNL_LIBRARY_NAME=dnnl
+ -DONEDNN_BUILD_GRAPH=ON
+ -DONEDNN_ENABLE_GRAPH_DUMP=OFF
+ -DONEDNN_EXPERIMENTAL_GRAPH_COMPILER_BACKEND=OFF
+ -Wno-dev
+ )
+
+ local isa="ALL"
+
+ if use cpu_flags_x86_avx512f ; then
+ isa="AVX512"
+ elif use cpu_flags_x86_avx2; then
+ isa="AVX2"
+ elif use cpu_flags_x86_sse4_1; then
+ isa="SSE41"
+ else
+ ewarn "WARNING: oneDNN is being built with for all ISA."
+ ewarn "These may cause runtime issues CPUs that are not supported by oneDNN."
+ ewarn ""
+ ewarn "To configure oneDNN with ISA that is optimal for your CPU,"
+ ewarn "set CPU_FLAGS_X86 in your make.conf, and re-emerge oneDNN."
+ ewarn ""
+ ewarn "See the list of supported CPUs at"
+ ewarn "https://github.com/oneapi-src/oneDNN?tab=readme-ov-file#system-requirements"
+ ewarn "For CPU_FLAGS_X86 documentation visit https://wiki.gentoo.org/wiki/CPU_FLAGS_*"
+ fi
+
+ mycmakeargs+=( -DDNNL_ENABLE_PRIMITIVE_CPU_ISA="${isa}" -DONEDNN_ENABLE_GEMM_KERNELS_ISA="${isa}" )
+
+ if use mkl ; then
+ source /opt/intel/oneapi/mkl/latest/env/vars.sh
+ mycmakeargs+=( -DDNNL_BLAS_VENDOR=MKL )
+ elif use cblas; then
+ mycmakeargs+=( -DDNNL_BLAS_VENDOR=ANY -DBLA_VENDOR=Generic -DBLAS_LIBRARIES=-lcblas )
+ else
+ mycmakeargs+=( -DDNNL_BLAS_VENDOR=NONE )
+ fi
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+ docs_compile
+}
+
+src_install() {
+ cmake_src_install
+
+ # Correct docdir
+ mv "${ED}/usr/share/doc/dnnl"* "${ED}/usr/share/doc/${PF}" || die
+}
diff --git a/profiles/features/musl/package.use.mask b/profiles/features/musl/package.use.mask
index 3fa72fa2eaa5..32a6ac3740dc 100644
--- a/profiles/features/musl/package.use.mask
+++ b/profiles/features/musl/package.use.mask
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Michał Górny <mgorny@gentoo.org> (2023-12-31)
@@ -145,3 +145,4 @@ app-shells/mksh -static
# linked against glibc
sci-libs/caffe2 mkl
+dev-libs/oneDNN mkl