From 9488cd1194d55d1abcff8a517a47e06e331b07d3 Mon Sep 17 00:00:00 2001 From: Christophe Paquot Date: Tue, 20 Jul 2021 08:04:04 -0700 Subject: [PATCH] SWDEV-240807 - Fix header file Remove class useage from header file Change-Id: Ibe1a59241f000cc162dd865484c313e56c4db95f [ROCm/clr commit: 223c0364f8fb6f7425ab1417fe54a35d30fde4a5] --- projects/clr/hipamd/src/hip_graph.cpp | 4 ++-- .../clr/hipamd/src/hip_graph_internal.cpp | 20 +++++++++---------- .../clr/hipamd/src/hip_graph_internal.hpp | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index 6e8235ec4d..ed592cbbfb 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -302,7 +302,7 @@ hipError_t hipStreamBeginCapture(hipStream_t stream, hipStreamCaptureMode mode) if (stream == nullptr || s->GetCaptureStatus() == hipStreamCaptureStatusActive) { HIP_RETURN(hipErrorInvalidValue); } - s->SetCaptureGraph(new hipGraph()); + s->SetCaptureGraph(new ihipGraph()); s->SetCaptureMode(mode); s->SetOriginStream(); g_captureStreams.push_back(stream); @@ -339,7 +339,7 @@ hipError_t hipStreamEndCapture(hipStream_t stream, hipGraph_t* pGraph) { hipError_t hipGraphCreate(hipGraph_t* pGraph, unsigned int flags) { HIP_INIT_API(hipGraphCreate, pGraph, flags); - *pGraph = new hipGraph(); + *pGraph = new ihipGraph(); HIP_RETURN(hipSuccess); } diff --git a/projects/clr/hipamd/src/hip_graph_internal.cpp b/projects/clr/hipamd/src/hip_graph_internal.cpp index 4ba3b1de7c..fe6618d8db 100644 --- a/projects/clr/hipamd/src/hip_graph_internal.cpp +++ b/projects/clr/hipamd/src/hip_graph_internal.cpp @@ -45,7 +45,7 @@ const char* GetGraphNodeTypeString(uint32_t op) { return case_string; }; -hipError_t hipGraph::AddNode(const Node& node) { +hipError_t ihipGraph::AddNode(const Node& node) { vertices_.emplace_back(node); nodeOutDegree_[node] = 0; nodeInDegree_[node] = 0; @@ -55,7 +55,7 @@ hipError_t hipGraph::AddNode(const Node& node) { return hipSuccess; } -hipError_t hipGraph::AddEdge(const Node& parentNode, const Node& childNode) { +hipError_t ihipGraph::AddEdge(const Node& parentNode, const Node& childNode) { // if vertice doesn't exist, add it to the graph if (std::find(vertices_.begin(), vertices_.end(), parentNode) == vertices_.end()) { AddNode(parentNode); @@ -84,7 +84,7 @@ hipError_t hipGraph::AddEdge(const Node& parentNode, const Node& childNode) { } // root nodes are all vertices with 0 in-degrees -std::vector hipGraph::GetRootNodes() const { +std::vector ihipGraph::GetRootNodes() const { std::vector roots; for (auto entry : vertices_) { if (nodeInDegree_.at(entry) == 0) { @@ -98,7 +98,7 @@ std::vector hipGraph::GetRootNodes() const { } // leaf nodes are all vertices with 0 out-degrees -std::vector hipGraph::GetLeafNodes() const { +std::vector ihipGraph::GetLeafNodes() const { std::vector leafNodes; for (auto entry : vertices_) { if (nodeOutDegree_.at(entry) == 0) { @@ -108,7 +108,7 @@ std::vector hipGraph::GetLeafNodes() const { return leafNodes; } -size_t hipGraph::GetLeafNodeCount() const { +size_t ihipGraph::GetLeafNodeCount() const { int numLeafNodes = 0; for (auto entry : vertices_) { if (nodeOutDegree_.at(entry) == 0) { @@ -118,7 +118,7 @@ size_t hipGraph::GetLeafNodeCount() const { return numLeafNodes; } -std::vector> hipGraph::GetEdges() const { +std::vector> ihipGraph::GetEdges() const { std::vector> edges; for (const auto& i : edges_) { for (const auto& j : i.second) { @@ -128,7 +128,7 @@ std::vector> hipGraph::GetEdges() const { return edges; } -void hipGraph::GetRunListUtil(Node v, std::unordered_map& visited, +void ihipGraph::GetRunListUtil(Node v, std::unordered_map& visited, std::vector& singleList, std::vector>& parallelLists, std::unordered_map>& dependencies) { @@ -174,7 +174,7 @@ void hipGraph::GetRunListUtil(Node v, std::unordered_map& visited, } // The function to do Topological Sort. // It uses recursive GetRunListUtil() -void hipGraph::GetRunList(std::vector>& parallelLists, +void ihipGraph::GetRunList(std::vector>& parallelLists, std::unordered_map>& dependencies) { std::vector singleList; @@ -196,7 +196,7 @@ void hipGraph::GetRunList(std::vector>& parallelLists, } } -hipError_t hipGraph::LevelOrder(std::vector& levelOrder) { +hipError_t ihipGraph::LevelOrder(std::vector& levelOrder) { std::vector roots = GetRootNodes(); std::unordered_map visited; std::queue q; @@ -374,4 +374,4 @@ hipError_t hipGraphExec::Run(hipStream_t stream) { command->release(); return hipSuccess; -} \ No newline at end of file +} diff --git a/projects/clr/hipamd/src/hip_graph_internal.hpp b/projects/clr/hipamd/src/hip_graph_internal.hpp index 7b949eca94..14629b75e9 100644 --- a/projects/clr/hipamd/src/hip_graph_internal.hpp +++ b/projects/clr/hipamd/src/hip_graph_internal.hpp @@ -58,15 +58,15 @@ class hipGraphNode { void SetLevel(uint32_t level) { level_ = level; } }; -class hipGraph { +class ihipGraph { std::unordered_map nodeInDegree_; // count of in coming edges for every vertex std::unordered_map nodeOutDegree_; // count of outgoing edges for every vertex std::vector vertices_; std::unordered_map> edges_; public: - hipGraph() {} - ~hipGraph(){}; + ihipGraph() {} + ~ihipGraph(){}; /// add node to the graph hipError_t AddNode(const Node& node); /// add edge to the graph