Removed bug calling start/end during sequence submit phase

This commit is contained in:
Alejandro Saucedo 2020-08-22 16:27:09 +01:00
parent ce00048d8c
commit 906533ae9d
5 changed files with 11 additions and 12 deletions

View file

@ -49,7 +49,7 @@ Algorithm::createParameters(std::vector<std::shared_ptr<Tensor>>& tensorParams)
// TODO: Explore design for having multiple descriptor pool sizes
std::vector<vk::DescriptorPoolSize> descriptorPoolSizes = {
vk::DescriptorPoolSize(vk::DescriptorType::eStorageBuffer,
1 // Descriptor count
static_cast<uint32_t>(tensorParams.size()) // Descriptor count
)
};
@ -99,6 +99,11 @@ Algorithm::createParameters(std::vector<std::shared_ptr<Tensor>>& tensorParams)
this->mDevice->allocateDescriptorSets(&descriptorSetAllocateInfo,
this->mDescriptorSet.get());
std::vector<vk::DescriptorBufferInfo> descriptorBufferInfos;
for (size_t i = 0; i < tensorParams.size(); i++) {
descriptorBufferInfos.push_back(tensorParams[i]->constructDescriptorBufferInfo());
}
// TODO: Explore design exposing the destination array element
std::vector<vk::WriteDescriptorSet> computeWriteDescriptorSets;
for (size_t i = 0; i < tensorParams.size(); i++) {

View file

@ -109,6 +109,7 @@ OpMult<tX, tY, tZ>::record()
{
SPDLOG_DEBUG("Kompute OpMult record called");
// Barrier to ensure the data is finished writing to buffer memory
this->mTensorLHS->recordBufferMemoryBarrier(
vk::AccessFlagBits::eHostWrite,
vk::AccessFlagBits::eShaderRead,
@ -122,6 +123,7 @@ OpMult<tX, tY, tZ>::record()
this->mAlgorithm->recordDispatch(this->mX, this->mY, this->mZ);
// Barrier to ensure the shader code is executed before buffer read
this->mTensorOutput->recordBufferMemoryBarrier(
vk::AccessFlagBits::eShaderWrite,
vk::AccessFlagBits::eTransferRead,
@ -140,6 +142,7 @@ OpMult<tX, tY, tZ>::record()
this->mTensorOutputStaging->recordCopyFrom(this->mTensorLHS);
// Buffer to ensure wait until data is copied to staging buffer
this->mTensorOutput->recordBufferMemoryBarrier(
vk::AccessFlagBits::eTransferWrite,
vk::AccessFlagBits::eHostRead,

View file

@ -52,5 +52,5 @@ class OpMult : public OpBase
} // End namespace kp
// Including implemenation for template class
#include "OpMult.tpp"
#include "OpMult.cpp"

View file

@ -97,11 +97,6 @@ Sequence::eval()
{
SPDLOG_DEBUG("Kompute sequence compute recording EVAL");
bool toggleSingleRecording = !this->mRecording;
if (toggleSingleRecording) {
this->begin();
}
const vk::PipelineStageFlags waitStageMask =
vk::PipelineStageFlagBits::eTransfer;
vk::SubmitInfo submitInfo(
@ -116,10 +111,6 @@ Sequence::eval()
this->mDevice->waitForFences(1, &fence, VK_TRUE, UINT64_MAX);
this->mDevice->destroy(fence);
if (toggleSingleRecording) {
this->end();
}
// TODO: Explore whether moving postSubmit calls to a separate sequence
// function that is explicitly called by the manager
for (size_t i = 0; i < this->mOperations.size(); i++) {

View file

@ -58,7 +58,7 @@ Tensor::init(std::shared_ptr<vk::PhysicalDevice> physicalDevice,
std::vector<uint32_t> data)
{
SPDLOG_DEBUG(
"Kompute Tensor running init with physicalDevice and logical device");
"Kompute Tensor running init with Vulkan params and data size: {}", data.size());
this->mPhysicalDevice = physicalDevice;
this->mDevice = device;