| # Copyright 2020 The Chromium OS Authors. All rights reserved. |
| # Distributed under the terms of the GNU General Public License v2 |
| |
| EAPI=7 |
| |
| CROS_WORKON_COMMIT="200ef2c67ab271519f18bac41f065de2cd22d96e" |
| CROS_WORKON_TREE=("791c6808b4f4f5f1c484108d66ff958d65f8f1e3" "e7dba8c91c1f3257c34d4a7ffff0ea2537aeb6bb") |
| inherit base cros-workon platform unpacker |
| |
| DESCRIPTION="Intel NNAPI HAL" |
| HOMEPAGE="https://github.com/intel/nn-hal" |
| NNHAL_GIT_HASH="1fed40d8b7cc73f47d19c488d52ba2d9c4ef6925" |
| NNHAL_GIT_SHORT_HASH=${NNHAL_GIT_HASH::8} |
| OPENVINO_GIT_HASH="a4a1bff1cc5a6b22f806adac8845d2806772dacd" |
| OPENVINO_GIT_SHORT_HASH=${OPENVINO_GIT_HASH::8} |
| SRC_URI=" |
| https://github.com/intel/nn-hal/archive/${NNHAL_GIT_HASH}.tar.gz -> intel-nn-hal-${NNHAL_GIT_SHORT_HASH}.tar.gz |
| https://github.com/openvinotoolkit/openvino/archive/${OPENVINO_GIT_HASH}.tar.xz -> intel-openvino-${OPENVINO_GIT_SHORT_HASH}.tar.xz |
| " |
| |
| |
| LICENSE="BSD-Google" |
| KEYWORDS="-* amd64" |
| IUSE="vendor-nnhal" |
| RESTRICT="strip" |
| |
| CROS_WORKON_PROJECT=("chromiumos/platform2") |
| CROS_WORKON_LOCALNAME=("platform2") |
| CROS_WORKON_DESTDIR=("${S}/platform2") |
| CROS_WORKON_SUBTREE=("common-mk .gn") |
| |
| PLATFORM_SUBDIR="nn-hal-${NNHAL_GIT_HASH}" |
| |
| RDEPEND=" |
| chromeos-base/aosp-frameworks-ml-nn |
| chromeos-base/intel-openvino |
| chromeos-base/intel-gnalib |
| " |
| |
| DEPEND=" |
| ${RDEPEND} |
| " |
| src_unpack() { |
| platform_src_unpack |
| |
| # Need to unpack the SRC_URI's into the platform2 dir |
| cd "${WORKDIR}/${PN}-${PV}/platform2" |
| unpacker_src_unpack |
| } |
| |
| src_configure() { |
| if use x86 || use amd64; then |
| append-cppflags "-D_Float16=__fp16" |
| append-cxxflags "-Xclang -fnative-half-type" |
| append-cxxflags "-Xclang -fallow-half-arguments-and-returns" |
| fi |
| platform_src_configure |
| } |
| |
| src_prepare() { |
| cros_enable_cxx_exceptions |
| eapply_user |
| } |
| |
| src_install() { |
| if use vendor-nnhal ; then |
| einfo "Installing Intel GNA vendor hal." |
| dolib.so "${OUT}/lib/libvendor-nn-hal.so" |
| dolib.so "${OUT}/lib/libintel_nnhal.so" |
| fi |
| } |