From b737af1977e7d85b31b15d3fdec70af3ae866675 Mon Sep 17 00:00:00 2001 From: kmagiers Date: Thu, 9 Jul 2020 14:33:48 +0200 Subject: [PATCH] [GNA] Fix cases when Gna2ModelGetLastError() returns unknown error --- inference-engine/src/gna_plugin/gna_device.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inference-engine/src/gna_plugin/gna_device.cpp b/inference-engine/src/gna_plugin/gna_device.cpp index bbd4891bef7a5b..e6170a86c588e9 100644 --- a/inference-engine/src/gna_plugin/gna_device.cpp +++ b/inference-engine/src/gna_plugin/gna_device.cpp @@ -123,7 +123,10 @@ void GNADeviceHelper::checkGna2Status(Gna2Status status, const Gna2Model& gnaMod } Gna2ModelError error; - Gna2ModelGetLastError(&error); + auto getLastErrorStatus = Gna2ModelGetLastError(&error); + if (!Gna2StatusIsSuccessful(getLastErrorStatus)) { + THROW_GNA_EXCEPTION << "\nUnsuccessful Gna2Status: (" << status << ") " << gna2StatusBuffer.data(); + } std::stringstream ss; ss << "\n GNA Library Error:\n";