diff options
author | Sv. Lockal <lockalsash@gmail.com> | 2024-03-08 15:38:20 +0000 |
---|---|---|
committer | Alfredo Tupone <tupone@gentoo.org> | 2024-03-08 23:15:10 +0100 |
commit | 629e9623f49d355891b62c368bcd95cc3a814b5d (patch) | |
tree | f1e44be7c75db77386029301f8a930579f7776e2 /dev-libs/oneDNN | |
parent | x11-drivers/nvidia-drivers: add 550.40.55:0/vulkan, drop 550.40.53 (diff) | |
download | gentoo-629e9623f49d355891b62c368bcd95cc3a814b5d.tar.gz gentoo-629e9623f49d355891b62c368bcd95cc3a814b5d.tar.bz2 gentoo-629e9623f49d355891b62c368bcd95cc3a814b5d.zip |
dev-libs/oneDNN: add 3.4
ebuild changes:
* exclude oneDNN-3.3.3-include-cstdint.patch - not needed anymore
* update CMAKE_SKIP_TESTS (known sys-apps/sandbox issue)
Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/35669
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'dev-libs/oneDNN')
-rw-r--r-- | dev-libs/oneDNN/Manifest | 1 | ||||
-rw-r--r-- | dev-libs/oneDNN/oneDNN-3.4.ebuild | 133 |
2 files changed, 134 insertions, 0 deletions
diff --git a/dev-libs/oneDNN/Manifest b/dev-libs/oneDNN/Manifest index 674f0426e148..4ebc5241e90d 100644 --- a/dev-libs/oneDNN/Manifest +++ b/dev-libs/oneDNN/Manifest @@ -1,2 +1,3 @@ DIST oneDNN-3.3.3.tar.gz 11577369 BLAKE2B 85df74235d70d30d69ebb1702dcb328466d38046b37f4078b1d6880c7cbe079d095e53e5c9e2f0f77daca057cae62e661ac1bf919e8f128cf9c76a847dc0425d SHA512 bb4a6b33b3191b9e517a321dd089b7debb528dd2d4be48f52626308fe0e1dbea3fa6149fd9debe6aa23f11224ac80e4d3ee1e251d2007faf9bcc262bb895de71 DIST oneDNN-3.3.4.tar.gz 11577725 BLAKE2B abfcf14f8f7ade2341004d3afdb2879814b50edb76dcc677f0c97aa061e3f5c958a8810fb3eb90926c7dc5d007406daf7b73e9ce660f8c0094a49338e9255f8c SHA512 ff31f3f6b59529aad47d5a8154572aa8d7e8267c4b8150aa32eeac7baa378e1dbfdc1adc6d503ebf1bd132bc09446019abf80e5dd8b54bd6aebfb08b7fb6b066 +DIST oneDNN-3.4.tar.gz 12858442 BLAKE2B 56af66755b133d8f6590d3712b4d8c7e331c5b6e4d92f99c7773a6be64331fa2a03159cf96ab4d979d0586c2bf060757895393eca5a2b06af2cfe80b80642aff SHA512 8a4ae6251e12ee641a432011da8360e08866ac005a5930d3a6278ce470d8b4a88afbd5538504274ca5e0bf053845efb41c834acaab83121d9d986a41f31ff718 diff --git a/dev-libs/oneDNN/oneDNN-3.4.ebuild b/dev-libs/oneDNN/oneDNN-3.4.ebuild new file mode 100644 index 000000000000..f63e938f040c --- /dev/null +++ b/dev-libs/oneDNN/oneDNN-3.4.ebuild @@ -0,0 +1,133 @@ +# 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 multiprocessing toolchain-funcs + +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 mkl cblas static-libs +openmp" + +RESTRICT="!test? ( test )" + +DEPEND=" + mkl? ( sci-libs/mkl ) + cblas? ( !mkl? ( virtual/cblas ) ) +" +RDEPEND="${DEPEND}" +BDEPEND=" + openmp? ( + || ( + sys-devel/gcc[openmp] + sys-devel/clang-runtime[openmp] + ) + ) +" + +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + +pkg_setup() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + +src_configure() { + if ! use openmp ; then + ewarn "WARNING: oneDNN is being built with sequential runtime." + ewarn "Proceeding might lead to highly sub-optimal performance." + ewarn "Conside enabling \"openmp\" USE flag." + fi + + local mycmakeargs=( + -DDNNL_LIBRARY_TYPE=$(usex static-libs STATIC SHARED) + -DDNNL_CPU_RUNTIME=$(usex openmp OMP SEQ) + -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 + -DDNNL_ENABLE_PRIMITIVE_CPU_ISA=ALL + -DONEDNN_ENABLE_GEMM_KERNELS_ISA=ALL + -Wno-dev + ) + + if use mkl ; then + if [ -e "${EPREFIX}"/opt/intel/oneapi/mkl/latest/env/vars.sh ]; then + source "${EPREFIX}"/opt/intel/oneapi/mkl/latest/env/vars.sh || die + else + # bug 923109: sci-libs/mkl-2020.4.304 has no vars.sh, configure it manually + export CPATH="${EPREFIX}"/usr/include/mkl + export MKLROOT="${EPREFIX}"/usr + fi + + 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 +} + +src_test() { + local CMAKE_SKIP_TESTS=( + # Crashes in sandbox (see #922886 and #923013); + # waits for sys-apps/sandbox-2.39 release and stabilization. + test_graph_unit_interface + test_graph_unit_dnnl_layout_propagator + test_graph_unit_dnnl_op_executable + test_graph_unit_utils + ) + + if use openmp ; then + # Don't run tests in parallel, each test is already parallelized + OMP_NUM_THREADS=$(makeopts_jobs) cmake_src_test -j1 + else + cmake_src_test + fi +} |