From deb3bdbe028a59da0759dd7a560387d03a11d322 Mon Sep 17 00:00:00 2001 From: surmeh01 Date: Thu, 5 Jul 2018 12:06:04 +0100 Subject: Release 18.05.02 --- Utils.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'Utils.cpp') diff --git a/Utils.cpp b/Utils.cpp index 01c2719b..99912201 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -63,8 +63,17 @@ void* GetMemoryFromPool(DataLocation location, const std::vector(static_cast(memPools[location.poolIndex].buffer)) + location.offset; + const android::nn::RunTimePoolInfo& memPool = memPools[location.poolIndex]; + + // Type android::nn::RunTimePoolInfo has changed between Android O and Android P, where + // "buffer" has been made private and must be accessed via the accessor method "getBuffer". +#if defined(ARMNN_ANDROID_P) // Use the new Android P implementation. + uint8_t* memPoolBuffer = memPool.getBuffer(); +#else // Fallback to the old Android O implementation. + uint8_t* memPoolBuffer = memPool.buffer; +#endif + + uint8_t* memory = memPoolBuffer + location.offset; return memory; } @@ -102,7 +111,7 @@ std::string GetOperandSummary(const Operand& operand) toString(operand.type); } -std::string GetModelSummary(const Model& model) +std::string GetModelSummary(const V1_0::Model& model) { std::stringstream result; @@ -273,7 +282,7 @@ void DumpTensor(const std::string& dumpDir, void ExportNetworkGraphToDotFile(const armnn::IOptimizedNetwork& optimizedNetwork, const std::string& dumpDir, - const Model& model) + const V1_0::Model& model) { // The dump directory must exist in advance. if (dumpDir.empty()) -- cgit v1.2.1