Renamed tensor and rebuild functions

This commit is contained in:
Alejandro Saucedo 2021-02-09 21:29:24 +00:00
parent 91252201ce
commit 0d9a9758da
2 changed files with 62 additions and 63 deletions

View file

@ -111,46 +111,34 @@ Manager::~Manager()
}
std::shared_ptr<Sequence>
Manager::getOrCreateManagedSequence(std::string sequenceName)
Manager::sequence(std::string sequenceName, uint32_t queueIndex)
{
SPDLOG_DEBUG("Kompute Manager creating Sequence object");
SPDLOG_DEBUG("Kompute Manager sequence() with sequenceName: {} "
"and queueIndex: {}",
sequenceName,
queueIndex);
std::shared_ptr<Sequence> sq = nullptr;
std::unordered_map<std::string, std::shared_ptr<Sequence>>::iterator found =
this->mManagedSequences.find(sequenceName);
if (found == this->mManagedSequences.end()) {
return this->createManagedSequence(sequenceName);
std::shared_ptr<Sequence> sq =
std::make_shared<Sequence>(this->mPhysicalDevice,
this->mDevice,
this->mComputeQueues[queueIndex],
this->mComputeQueueFamilyIndices[queueIndex]);
sq->init();
this->mManagedSequences.insert({ sequenceName, sq });
return sq;
} else {
return found->second;
}
}
std::shared_ptr<Sequence>
Manager::createManagedSequence(std::string sequenceName, uint32_t queueIndex)
{
SPDLOG_DEBUG("Kompute Manager createManagedSequence with sequenceName: {} "
"and queueIndex: {}",
sequenceName,
queueIndex);
std::shared_ptr<Sequence> sq =
std::make_shared<Sequence>(this->mPhysicalDevice,
this->mDevice,
this->mComputeQueues[queueIndex],
this->mComputeQueueFamilyIndices[queueIndex]);
sq->init();
if (sequenceName.empty()) {
this->mCurrentSequenceIndex++;
this->mManagedSequences.insert({ KP_DEFAULT_SESSION, sq });
} else {
// TODO: Check if sequence doesn't already exist
this->mManagedSequences.insert({ sequenceName, sq });
}
return sq;
}
void
Manager::createInstance()
{