const Stage& stage,
const DataDesc& desc);
+ StageTempBuffer addTempBuffer(
+ const Stage& stage,
+ size_t bufferSize);
+
void replaceStageInput(
const StageInput& edge,
const Data& newInput);
std::make_shared<ConvIm2ColWeightsContent>(weights->content(), newWeightsDesc));
double im2ColBufSizeF = static_cast<double>(kernelSizeX) * kernelSizeY *
- output->desc().dim(Dim::W) * output->desc().dim(Dim::H) * input->desc().dim(Dim::C)
- + 32;
+ output->desc().dim(Dim::W) * output->desc().dim(Dim::H) * input->desc().dim(Dim::C) * sizeof(int16_t)
+ + 64;
if (im2ColBufSizeF >= std::numeric_limits<int>::max()) {
VPU_THROW_EXCEPTION << "stage: " << name() << ", im2col bufferSize cannot fit 32s: "
<< output->desc().dim(Dim::W) << "x" << output->desc().dim(Dim::H) << "x" << output->desc().dim(Dim::C) << ")";
}
- model()->addTempBuffer(this, DataDesc({static_cast<int>(im2ColBufSizeF)}));
+ model()->addTempBuffer(this, static_cast<int>(im2ColBufSizeF));
}
weights->attrs().set<Data>("swWeights", swWeights);
return edge;
}
+StageTempBuffer ModelObj::addTempBuffer(
+ const Stage& stage,
+ size_t bufferSize) {
+ auto desc = DataDesc(DataType::U8, DimsOrder::C, {bufferSize});
+ return addTempBuffer(stage, desc);
+}
+
StageTempBuffer ModelObj::addTempBuffer(
const Stage& stage,
const DataDesc& desc) {
stage->attrs().set("outputOrders", std::move(outputOrders));
int buffer_size = kernel.kernelBinary().length() + 1024;
- model->addTempBuffer(
- stage,
- DataDesc({buffer_size}));
+ model->addTempBuffer(stage, buffer_size);
}
}
size_num_priors_actual_buf +
size_temp_data_buf;
- model->addTempBuffer(stage, DataDesc({buffer_size}));
+ model->addTempBuffer(stage, buffer_size);
}
} // namespace vpu
const auto& env = CompileEnv::get();
const int required_cmx_buffer_size = env.resources.numSHAVEs * required_cmx_size_per_shave;
- model->addTempBuffer(
- stage,
- DataDesc({buffer_size + required_cmx_buffer_size}));
+ model->addTempBuffer(stage, buffer_size + required_cmx_buffer_size);
}
} // namespace vpu
outputData);
if (nCells > 1)
- model->addTempBuffer(stage, DataDesc({stateSize}));
+ model->addTempBuffer(stage, sizeof(uint16_t) * stateSize);
bool RNNForward = layer->direction == ie::RNNSequenceLayer::FWD;
stage->attrs().set<bool>("RNNForward", RNNForward);
size_dummy_mapping_buf +
size_repacked_buf;
- model->addTempBuffer(stage, DataDesc({buffer_size}));
+ model->addTempBuffer(stage, buffer_size);
}
} // namespace vpu