blob: 672445c65ff43816c0c60cfd37d53f734598c496 [file] [log] [blame]
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cros-workon platform git-r3
DESCRIPTION="Intel NNAPI HAL"
HOMEPAGE="https://github.com/intel/nn-hal"
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"
RDEPEND="
chromeos-base/aosp-frameworks-ml-nn
chromeos-base/intel-openvino
"
DEPEND="
${RDEPEND}
"
src_unpack() {
platform_src_unpack
EGIT_REPO_URI="https://github.com/intel/nn-hal.git" \
EGIT_CHECKOUT_DIR="${S}" \
EGIT_COMMIT="8596953fb5904214ef770941f2a68633814797ab" \
EGIT_BRANCH="chromeos-vpu" \
git-r3_src_unpack
EGIT_REPO_URI="https://github.com/openvinotoolkit/openvino.git" \
EGIT_CHECKOUT_DIR="${S}/../intel-openvino-dev" \
EGIT_COMMIT="2022.3.0" \
git-r3_src_unpack
}
src_prepare() {
cros_enable_cxx_exceptions
eapply_user
}
src_configure() {
if use x86 || use amd64; then
append-cppflags "-D_Float16=__fp16"
append-cxxflags "-Xclang -fnative-half-type"
append-cxxflags "-Xclang -fnative-half-arguments-and-returns"
fi
platform_src_configure
}
src_install() {
platform_src_install
if use vendor-nnhal ; then
einfo "Installing Intel VPU vendor hal."
dolib.so "${OUT}/lib/libvendor-nn-hal.so"
dolib.so "${OUT}/lib/libintel_nnhal.so"
fi
}