diff options
Diffstat (limited to 'shim/sl/scripts')
-rw-r--r-- | shim/sl/scripts/NeuralNetworks.patch | 24 | ||||
-rwxr-xr-x | shim/sl/scripts/clone_aosp_libs.sh | 39 | ||||
-rwxr-xr-x | shim/sl/scripts/modify_aosp_libs.sh | 4 |
3 files changed, 45 insertions, 22 deletions
diff --git a/shim/sl/scripts/NeuralNetworks.patch b/shim/sl/scripts/NeuralNetworks.patch index c33177e081..81e859bd67 100644 --- a/shim/sl/scripts/NeuralNetworks.patch +++ b/shim/sl/scripts/NeuralNetworks.patch @@ -1,13 +1,17 @@ -diff --git a/common/SharedMemoryAndroid.cpp b/common/SharedMemoryAndroid.cpp -index 4730de36b..896d643e7 100644 ---- a/common/SharedMemoryAndroid.cpp -+++ b/common/SharedMemoryAndroid.cpp -@@ -160,8 +160,19 @@ GeneralResult<SharedMemory> allocateSharedMemory(size_t size) { +diff --git a/common/types/src/SharedMemoryAndroid.cpp b/common/types/src/SharedMemoryAndroid.cpp +index c361a1eb6..3c09c5f4d 100644 +--- a/common/types/src/SharedMemoryAndroid.cpp ++++ b/common/types/src/SharedMemoryAndroid.cpp +@@ -115,8 +115,23 @@ GeneralResult<SharedMemory> allocateSharedMemory(size_t size) { return createSharedMemoryFromUniqueFd(size, prot, std::move(fd), offset); } -GeneralResult<Mapping> map(const Memory::Ashmem& /*memory*/) { - return NN_ERROR(ErrorStatus::INVALID_ARGUMENT) << "Cannot map ashmem memory"; ++//GeneralResult<Mapping> map(const Memory::Ashmem& /*memory*/) { ++// return NN_ERROR(ErrorStatus::INVALID_ARGUMENT) << "Cannot map ashmem memory"; ++//} ++ +GeneralResult<Mapping> map(const Memory::Ashmem& memory) { + constexpr off64_t offset = 0; + constexpr int prot = PROT_READ | PROT_WRITE; @@ -25,15 +29,15 @@ index 4730de36b..896d643e7 100644 #endif // NN_COMPATIBILITY_LIBRARY_BUILD diff --git a/runtime/NeuralNetworks.cpp b/runtime/NeuralNetworks.cpp -index b91d3ce45..8977dac68 100644 +index 678888e9f..805a600bb 100644 --- a/runtime/NeuralNetworks.cpp +++ b/runtime/NeuralNetworks.cpp -@@ -1859,7 +1859,7 @@ int SL_ANeuralNetworksDevice_forEachVendorExtensionOperandTypeInformation( +@@ -1927,7 +1927,7 @@ int SL_ANeuralNetworksDevice_forEachVendorExtensionOperandTypeInformation( #define NNCL_FUNC(symbol) .symbol = symbol - NnApiSLDriverImplFL5 slDriverImpl{ -- .base{.implFeatureLevel = ANEURALNETWORKS_FEATURE_LEVEL_5}, -+ .base={.implFeatureLevel = ANEURALNETWORKS_FEATURE_LEVEL_5}, + NnApiSLDriverImplFL7 slDriverImpl{ +- .base{.implFeatureLevel = ANEURALNETWORKS_FEATURE_LEVEL_7}, ++ .base={.implFeatureLevel = ANEURALNETWORKS_FEATURE_LEVEL_7}, NNCL_FUNC(ANeuralNetworksBurst_create), NNCL_FUNC(ANeuralNetworksBurst_free), NNCL_FUNC(ANeuralNetworksCompilation_createForDevices), diff --git a/shim/sl/scripts/clone_aosp_libs.sh b/shim/sl/scripts/clone_aosp_libs.sh index a33e341f9f..3a8615a19a 100755 --- a/shim/sl/scripts/clone_aosp_libs.sh +++ b/shim/sl/scripts/clone_aosp_libs.sh @@ -3,40 +3,63 @@ SCRIPT_PATH=$(dirname "$0") AOSP_DIR="${SCRIPT_PATH}/../aosp/" -# NNAPI SUPPORT +# NNAPI SUPPORT (SHA's for each repo taken from master branch 25/03/22) git clone https://android.googlesource.com/platform/packages/modules/NeuralNetworks/ "${AOSP_DIR}/packages/modules/NeuralNetworks" pushd "${AOSP_DIR}/packages/modules/NeuralNetworks" -git checkout remotes/origin/android12-s1-release +git checkout 9c2360318a35756addcd5d321a85f9270e0a04da popd git clone https://android.googlesource.com/platform/system/core "${AOSP_DIR}/system/core/" pushd "${AOSP_DIR}/system/core/" -git checkout remotes/origin/android12-s1-release +git checkout c408ee943a1d9c486e4fac10bee7f76a61c75bab popd git clone https://android.googlesource.com/platform/system/libbase "${AOSP_DIR}/system/libbase" pushd "${AOSP_DIR}/system/libbase" -git checkout remotes/origin/android12-s1-release +git checkout 2d235ac982044ea4985c39a834e2d85c6a8bca8f popd git clone https://android.googlesource.com/platform/system/libfmq "${AOSP_DIR}/system/libfmq" pushd "${AOSP_DIR}/system/libfmq" -git checkout remotes/origin/android12-s1-release +git checkout 331b20e54ddde93785d7688ebb0cdc1cbcf9fd9b popd git clone https://android.googlesource.com/platform/frameworks/native "${AOSP_DIR}/frameworks/native" pushd "${AOSP_DIR}/frameworks/native" -git checkout remotes/origin/android12-s1-release +git checkout fea6523ac18c9d4d40db04c996e833f60ff88489 popd git clone https://android.googlesource.com/platform/system/logging "${AOSP_DIR}/system/logging" pushd "${AOSP_DIR}/system/logging" -git checkout remotes/origin/android12-s1-release +git checkout e1a669e529cf5a42cd8b331ca89634bb9dce5cae popd git clone https://android.googlesource.com/platform/external/boringssl "${AOSP_DIR}/external/boringssl" pushd "${AOSP_DIR}/external/boringssl" -git checkout remotes/origin/android12-s1-release +git checkout ebeca38b4ecbe81fdf1d127ef7abb4689722308c +popd + +git clone https://android.googlesource.com/platform/external/tensorflow "${AOSP_DIR}/external/tensorflow" +pushd "${AOSP_DIR}/external/tensorflow" +git checkout a6772d90a9b542ceb50f35f67e1cebf322d8b0d0 +popd + +git clone https://android.googlesource.com/platform/external/eigen "${AOSP_DIR}/external/eigen" +pushd "${AOSP_DIR}/external/eigen" +git checkout 10f298fc4175c1b8537c674f654a070c871960e5 +popd + +git clone https://android.googlesource.com/platform/external/ruy "${AOSP_DIR}/external/ruy" +pushd "${AOSP_DIR}/external/ruy" +git checkout 4377b97cf0850e0a61caa191586ebe68ccbc2abf +popd + +git clone https://android.googlesource.com/platform/external/gemmlowp "${AOSP_DIR}/external/gemmlowp" +pushd "${AOSP_DIR}/external/gemmlowp" +git checkout 689c69e88b91e7bff068e33396f74c0a5b17390e popd git clone https://android.googlesource.com/platform/prebuilts/vndk/v29 "${AOSP_DIR}/prebuilts/vndk/v29" +pushd "${AOSP_DIR}/prebuilts/vndk/v29" +git checkout 5a73511dd91512681df643ce604d36763cd81b0e +popd diff --git a/shim/sl/scripts/modify_aosp_libs.sh b/shim/sl/scripts/modify_aosp_libs.sh index b10a36cfd1..104e99105e 100755 --- a/shim/sl/scripts/modify_aosp_libs.sh +++ b/shim/sl/scripts/modify_aosp_libs.sh @@ -13,10 +13,6 @@ popd pushd "${AOSP_DIR}/packages/modules/NeuralNetworks/" echo "Applying NeuralNetworks patch" git apply "${SCRIPT_PATH}/NeuralNetworks.patch" - - echo " Checking out master version of SharedMemory.h/.cpp which includes convertRequestFromPointerToShared" - git checkout 736317504083629929373bd349f667893bc8204c -- common/SharedMemory.cpp - git checkout 736317504083629929373bd349f667893bc8204c -- common/include/nnapi/SharedMemory.h popd pushd "${SCRIPT_PATH}/.." |