Updating sequence to have isInit until init run
This commit is contained in:
parent
650975838c
commit
b34984b713
2 changed files with 13 additions and 11 deletions
|
|
@ -58,6 +58,16 @@ Manager::~Manager()
|
|||
return;
|
||||
}
|
||||
|
||||
if (this->mManagedSequences.size()) {
|
||||
SPDLOG_DEBUG("Kompute Manager explicitly running destructor for "
|
||||
"managed sequences");
|
||||
for (const std::pair<std::string, std::shared_ptr<Sequence>>& sqPair :
|
||||
this->mManagedSequences) {
|
||||
sqPair.second->freeMemoryDestroyGPUResources();
|
||||
}
|
||||
this->mManagedSequences.clear();
|
||||
}
|
||||
|
||||
if (this->mManagedTensors.size()) {
|
||||
SPDLOG_DEBUG("Kompute Manager explicitly freeing tensors");
|
||||
for (const std::shared_ptr<Tensor>& tensor : this->mManagedTensors) {
|
||||
|
|
@ -70,16 +80,6 @@ Manager::~Manager()
|
|||
this->mManagedTensors.clear();
|
||||
}
|
||||
|
||||
if (this->mManagedSequences.size()) {
|
||||
SPDLOG_DEBUG("Kompute Manager explicitly running destructor for "
|
||||
"managed sequences");
|
||||
for (const std::pair<std::string, std::shared_ptr<Sequence>>& sqPair :
|
||||
this->mManagedSequences) {
|
||||
sqPair.second->freeMemoryDestroyGPUResources();
|
||||
}
|
||||
this->mManagedSequences.clear();
|
||||
}
|
||||
|
||||
if (this->mFreeDevice) {
|
||||
SPDLOG_INFO("Destroying device");
|
||||
this->mDevice->destroy(
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Sequence::Sequence(std::shared_ptr<vk::PhysicalDevice> physicalDevice,
|
|||
this->mDevice = device;
|
||||
this->mComputeQueue = computeQueue;
|
||||
this->mQueueIndex = queueIndex;
|
||||
this->mIsInit = true;
|
||||
this->mIsInit = false;
|
||||
}
|
||||
|
||||
Sequence::~Sequence()
|
||||
|
|
@ -203,6 +203,8 @@ Sequence::isInit()
|
|||
void
|
||||
Sequence::freeMemoryDestroyGPUResources()
|
||||
{
|
||||
SPDLOG_DEBUG("Kompute Sequence freeMemoryDestroyGPUResources called");
|
||||
|
||||
if (!this->mIsInit) {
|
||||
SPDLOG_ERROR("Kompute Sequence freeMemoryDestroyGPUResources called "
|
||||
"but Sequence is not initialized so there's no relevant "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue