| 106 | } |
| 107 | |
| 108 | std::shared_ptr<Sequence> |
| 109 | Sequence::evalAsync() |
| 110 | { |
| 111 | if (this->isRecording()) { |
| 112 | this->end(); |
| 113 | } |
| 114 | |
| 115 | if (this->mIsRunning) { |
| 116 | throw std::runtime_error( |
| 117 | "Kompute Sequence evalAsync called when an eval async was " |
| 118 | "called without successful wait"); |
| 119 | } |
| 120 | |
| 121 | this->mIsRunning = true; |
| 122 | |
| 123 | for (size_t i = 0; i < this->mOperations.size(); i++) { |
| 124 | this->mOperations[i]->preEval(*this->mCommandBuffer); |
| 125 | } |
| 126 | |
| 127 | vk::SubmitInfo submitInfo( |
| 128 | 0, nullptr, nullptr, 1, this->mCommandBuffer.get()); |
| 129 | |
| 130 | this->mFence = this->mDevice->createFence(vk::FenceCreateInfo()); |
| 131 | |
| 132 | KP_LOG_DEBUG( |
| 133 | "Kompute sequence submitting command buffer into compute queue"); |
| 134 | |
| 135 | this->mComputeQueue->submit(1, &submitInfo, this->mFence); |
| 136 | |
| 137 | return shared_from_this(); |
| 138 | } |
| 139 | |
| 140 | std::shared_ptr<Sequence> |
| 141 | Sequence::evalAsync(std::shared_ptr<OpBase> op) |