[IE][VPU]: ExpGenerateProposals: added temporary buffer allocation (#3093)

ExpGenerateProposals: temporary buffer allocation moved from firmware to blob
* Added tmpBuffer
* Changed the amount of allocated memory
* firmware update

Co-authored-by: Ivan Poliksenov <ivan.poliksenov@intel.com>
This commit is contained in:
Alexey Ershov 2020-11-16 18:03:19 +03:00 committed by GitHub
parent 1fd07663c9
commit 6efcdb0a21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -19,7 +19,7 @@ set(VPU_SUPPORTED_FIRMWARES usb-ma2x8x pcie-ma248x)
# Default packages # Default packages
# #
set(FIRMWARE_PACKAGE_VERSION 1474) set(FIRMWARE_PACKAGE_VERSION 1492)
set(VPU_CLC_MA2X8X_VERSION "movi-cltools-20.09.2") set(VPU_CLC_MA2X8X_VERSION "movi-cltools-20.09.2")
# #

View File

@ -60,6 +60,8 @@ private:
for (auto& outputEdge : outputEdges()) { for (auto& outputEdge : outputEdges()) {
outputEdge->output()->serializeBuffer(serializer); outputEdge->output()->serializeBuffer(serializer);
} }
tempBuffer(0)->serializeBuffer(serializer);
} }
}; };
@ -129,6 +131,29 @@ void FrontEnd::parseExpGenerateProposals(
outputs); outputs);
stage->attrs().set("params", params); stage->attrs().set("params", params);
//This structure is needed to compute sizeProposalBuf.
//Since its outside the scope of the file, we write structure here
typedef struct {
int32_t idx;
fp16_t x0;
fp16_t y0;
fp16_t x1;
fp16_t y1;
fp16_t score;
} t_ExpGenerateProposalsProposal;
const int ALIGN_VALUE = 64;
const int sizeProposalsBuf = sizeof(t_ExpGenerateProposalsProposal) *
inputScores->desc().dim(Dim::H) *
inputScores->desc().dim(Dim::W) *
inputScores->desc().dim(Dim::C) + ALIGN_VALUE;
const int sizeAuxBuf = sizeof(int8_t) * params.pre_nms_topn + ALIGN_VALUE;
const int sizeRoiIndicesBuf = sizeof(int32_t) * params.post_nms_topn + ALIGN_VALUE;
int buffer_size = 2 * sizeProposalsBuf + sizeAuxBuf + sizeRoiIndicesBuf;
model->addTempBuffer(stage, buffer_size);
} }
} // namespace vpu } // namespace vpu