Skip to content

Commit

Permalink
[GNA] Additional checks (openvinotoolkit#1018)
Browse files Browse the repository at this point in the history
  • Loading branch information
dorloff authored Aug 21, 2020
1 parent f009be6 commit 3ae90cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions inference-engine/src/gna_plugin/backend/am_intel_dnn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,8 @@ void GNAPluginNS::backend::AMIntelDNN::InitGNAStruct(intel_nnet_type_t *ptr_nnet
case kDnnPiecewiselinearOp:
#if GNA_LIB_VER == 2
{
IE_ASSERT(gnaOperation->Operands != nullptr);
IE_ASSERT(OutOpIdx < gnaOperation->NumberOfOperands);
auto& outputTensor = const_cast<Gna2Tensor&>(*gnaOperation->Operands[OutOpIdx]);
outputTensor.Data = comp.ptr_outputs;
outputTensor.Type = Gna2DataTypeFromBytes(comp.num_bytes_per_output);
Expand Down
1 change: 1 addition & 0 deletions inference-engine/src/gna_plugin/gna_graph_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ void GNAGraphCompiler::ConvolutionPrimitive(InferenceEngine::CNNLayerPtr layer)
void GNAGraphCompiler::PowerPrimitive(InferenceEngine::CNNLayerPtr layer) {
auto& power = dynamic_cast<PowerLayer&>(*layer.get());
auto quantized = InferenceEngine::getInjectedData<QuantizedLayerParams>(layer);
IE_ASSERT(gnaFlags->sw_fp32 ? (quantized == nullptr) : (quantized != nullptr));

if (power.power < 0.0f || power.power > 2.8f) {
THROW_IE_EXCEPTION << "[GNA plugin] unsupported power factor, expected be in <0, 2.8> range but was " << power.power;
Expand Down
1 change: 1 addition & 0 deletions inference-engine/src/gna_plugin/gna_model_serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ void GNAModelSerial::Import(void *basePointer,
for (uint32_t i = 0; i < operation->NumberOfParameters; i++) {
uint32_t paramSize = 0;
readBits(paramSize, is);
IE_ASSERT(operation->Parameters != nullptr);
if (paramSize == 0) {
IE_ASSERT(operation->Parameters != nullptr);
operation->Parameters[i] = nullptr;
Expand Down

0 comments on commit 3ae90cf

Please sign in to comment.