Follow up CL to "Adjust code in response to Burst validation tests"
Bug: 129779280
Bug: 129157135
Test: mma
Change-Id: I36746ba31a6a68ead2a00f6135a5a6db83c32d14
Merged-In: I36746ba31a6a68ead2a00f6135a5a6db83c32d14
(cherry picked from commit 1ee58a58a03d9e9db2e662102023f46a67b01577)
diff --git a/nn/common/ExecutionBurstServer.cpp b/nn/common/ExecutionBurstServer.cpp
index e9dc179..599f57d 100644
--- a/nn/common/ExecutionBurstServer.cpp
+++ b/nn/common/ExecutionBurstServer.cpp
@@ -42,10 +42,7 @@
bool isCacheEntryPresent(int32_t slot) const override {
const auto it = mMemoryCache.find(slot);
- if (it == mMemoryCache.end()) {
- return false;
- }
- return it->second.valid();
+ return (it != mMemoryCache.end()) && it->second.valid();
}
void addCacheEntry(const hidl_memory& memory, int32_t slot) override {
@@ -415,7 +412,11 @@
<< "ResultChannelSender::sendPacket -- packet size exceeds size available in FMQ";
const std::vector<FmqResultDatum> errorPacket =
serialize(ErrorStatus::GENERAL_FAILURE, {}, kNoTiming);
- return mFmqResultChannel->writeBlocking(errorPacket.data(), errorPacket.size());
+ if (mBlocking) {
+ return mFmqResultChannel->writeBlocking(errorPacket.data(), errorPacket.size());
+ } else {
+ return mFmqResultChannel->write(errorPacket.data(), errorPacket.size());
+ }
}
if (mBlocking) {