Added end to end implementation of OpMult with postSubmit calls on sequence

This commit is contained in:
Alejandro Saucedo 2020-08-22 12:08:18 +01:00
parent 03688bc5b2
commit 8f6078c422
8 changed files with 62 additions and 8 deletions

View file

@ -43,17 +43,24 @@ OpMult::init(std::vector<std::shared_ptr<Tensor>> tensors)
this->mTensorRHS = tensors[1];
this->mTensorOutput = tensors[2];
// TODO: Explore adding a validate function
if (!(this->mTensorLHS->isInit() && this->mTensorRHS->isInit() && this->mTensorOutput->isInit())) {
throw std::runtime_error("Kompute OpMult all tensor parameters must be initialised. LHS: " + std::to_string(this->mTensorLHS->isInit()) + " RHS: " + std::to_string(this->mTensorRHS->isInit()) + " Output: " + std::to_string(this->mTensorOutput->isInit()));
}
// TODO: Explore use-cases where tensors shouldn't be the same size, and how to deal with those situations
if (!(this->mTensorLHS->size() == this->mTensorRHS->size() && this->mTensorRHS->size() == this->mTensorOutput->size())) {
throw std::runtime_error("Kompute OpMult all tensor parameters must be the same size LHS: " + std::to_string(this->mTensorLHS->size()) + " RHS: " + std::to_string(this->mTensorRHS->size()) + " Output: " + std::to_string(this->mTensorOutput->size()));
}
this->mTensorOutputStaging = std::make_shared<Tensor>(
this->mTensorOutput->data(), Tensor::TensorTypes::eStaging);
this->mTensorOutputStaging->init(this->mPhysicalDevice, this->mDevice, this->mCommandBuffer, this->mTensorOutput->data());
// TODO: Make this path configurable
this->mAlgorithm->init(
"shaders/glsl/computeheadless.comp.spv", tensors);
"shaders/glsl/opmult.comp.spv", tensors);
}
void