Skip to content

Commit fb7ad83

Browse files
Anusha GodavarthySuryaAnusha Godavarthy Surya
authored andcommitted
SWDEV-489084 - Update max streams for graph
Change-Id: I6d0992b2e80ebf3184911593a4f3574327b2e9c3
1 parent 06e6561 commit fb7ad83

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

hipamd/src/hip_graph_internal.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ void Graph::ScheduleOneNode(Node node, int stream_id) {
247247
if (node->stream_id_ == -1) {
248248
// Assign active stream to the current node
249249
node->stream_id_ = stream_id;
250-
max_streams_ = std::max(max_streams_, stream_id);
250+
max_streams_ = std::max(max_streams_, (stream_id + 1));
251251

252252
// Update the dependencies if a signal is required
253253
for (auto dep: node->GetDependencies()) {
@@ -414,7 +414,7 @@ hipError_t GraphExec::Init() {
414414
status = CreateStreams(parallelLists_.size() - 1 + min_num_streams);
415415
} else {
416416
// create extra stream to avoid queue collision with the default execution stream
417-
status = CreateStreams(clonedGraph_->max_streams_ + 1);
417+
status = CreateStreams(clonedGraph_->max_streams_);
418418
}
419419
if (status != hipSuccess) {
420420
return status;

hipamd/src/hip_graph_internal.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ struct Graph {
488488
std::unordered_map<UserObject*, int> graphUserObj_;
489489
unsigned int id_;
490490
static int nextID;
491-
int max_streams_ = 0; //!< Maximum number of extra streams used in the graph launch
491+
int max_streams_ = 0; //!< Maximum number of streams used in the graph launch
492492
uint32_t memalloc_nodes_ = 0; //!< Count of unreleased Memalloc nodes
493493
std::vector<Node> roots_; //!< Root nodes, used in parallel launches
494494
std::vector<Node> leafs_; //!< The list of leaf nodes on every parallel stream

0 commit comments

Comments
 (0)