Added destructor for staging tensors

This commit is contained in:
Alejandro Saucedo 2021-02-06 19:09:48 +00:00
parent df5477a2d7
commit c8283844d6

View file

@ -23,6 +23,16 @@ OpTensorCreate::OpTensorCreate(
OpTensorCreate::~OpTensorCreate()
{
SPDLOG_DEBUG("Kompute OpTensorCreate destructor started");
SPDLOG_DEBUG("Kompute OpBase freeing staging tensors");
for (std::shared_ptr<Tensor> tensor : this->mStagingTensors) {
if (tensor && tensor->isInit()) {
tensor->freeMemoryDestroyGPUResources();
} else {
SPDLOG_ERROR("Kompute OpBase expected to free "
"tensor but has already been freed.");
}
}
}
void