SWDEV-366653 - Added Implemention of DOT file generation for graph

Change-Id: I5ab6a58e49451b5e04f2e93bf594b985ac58cc8d
This commit is contained in:
Anusha Godavarthy Surya
2022-11-11 03:45:27 +00:00
committed by Anusha Godavarthy Surya
parent 5ec93c544e
commit 08c4619fab
3 changed files with 351 additions and 32 deletions
+18 -1
View File
@@ -2144,9 +2144,26 @@ hipError_t hipGraphKernelNodeCopyAttributes(hipGraphNode_t hSrc, hipGraphNode_t
HIP_RETURN(hipErrorNotSupported);
}
hipError_t ihipGraphDebugDotPrint(hipGraph_t graph, const char* path, unsigned int flags) {
if (graph == nullptr || path == nullptr) {
return hipErrorInvalidValue;
}
std::ofstream fout;
fout.open(path, std::ios::out);
if (fout.fail()) {
ClPrint(amd::LOG_INFO, amd::LOG_API, "[hipGraph] Error during opening of file : %s", path);
return hipErrorOperatingSystem;
}
fout << "digraph dot {" << std::endl;
graph->GenerateDOT(fout, (hipGraphDebugDotFlags)flags);
fout << "}" << std::endl;
fout.close();
return hipSuccess;
}
hipError_t hipGraphDebugDotPrint(hipGraph_t graph, const char* path, unsigned int flags) {
HIP_INIT_API(hipGraphDebugDotPrint, graph, path, flags);
HIP_RETURN(hipErrorNotSupported);
HIP_RETURN(ihipGraphDebugDotPrint(graph, path, flags));
}
hipError_t hipGraphNodeSetEnabled(hipGraphExec_t hGraphExec, hipGraphNode_t hNode,