SWDEV-392732 - Initial commit for graph doorbell optimization(AQL Buffering)

Change-Id: I451725006c54c249dc530c55d2af2a31594bf49b
This commit is contained in:
Anusha GodavarthySurya
2023-06-17 13:48:05 +00:00
committed by Anusha Godavarthy Surya
parent 84559d0d6f
commit b0e6f99ad7
7 changed files with 149 additions and 19 deletions
+14 -2
View File
@@ -611,8 +611,20 @@ hipError_t hipGraphExec::Run(hipStream_t stream) {
cmd->enqueue();
cmd->release();
}
for (auto& node : topoOrder_) {
node->EnqueueCommands(stream);
for (int i = 0; i < topoOrder_.size(); i++) {
if (DEBUG_CLR_GRAPH_ENABLE_BUFFERING) {
// Enable buffering for graph with single branch
if (parallelLists_.size() == 1) {
// Peep through the next node. If current and next node are kernel then enable AQL
// buffering
if (((i + 1) != topoOrder_.size()) &&
topoOrder_[i]->GetType() == hipGraphNodeTypeKernel &&
topoOrder_[i + 1]->GetType() == hipGraphNodeTypeKernel) {
topoOrder_[i]->EnableBuffering();
}
}
}
topoOrder_[i]->EnqueueCommands(stream);
}
if (endCommand != nullptr) {
endCommand->enqueue();
+5
View File
@@ -326,6 +326,11 @@ struct hipGraphNode : public hipGraphNodeDOTAttribute {
command->release();
}
}
virtual void EnableBuffering() {
for (auto& command : commands_) {
command->setBufferingState(true);
}
}
ihipGraph* GetParentGraph() { return parentGraph_; }
virtual ihipGraph* GetChildGraph() { return nullptr; }
void SetParentGraph(ihipGraph* graph) { parentGraph_ = graph; }