@@ -116,11 +116,11 @@ class UserObject : public amd::ReferenceCountedObject {
116116
117117class hipGraphNodeDOTAttribute {
118118 protected:
119- std::string style_;
120- std::string shape_;
121- std::string label_;
119+ const char * style_;
120+ const char * shape_;
121+ const char * label_;
122122
123- hipGraphNodeDOTAttribute (std::string style, std::string shape, std::string label) {
123+ hipGraphNodeDOTAttribute (const char * style, const char * shape, const char * label) {
124124 style_ = style;
125125 shape_ = shape;
126126 label_ = label;
@@ -138,13 +138,7 @@ class hipGraphNodeDOTAttribute {
138138 label_ = node.label_ ;
139139 }
140140
141- void SetStyle (std::string style) { style_ = style; }
142-
143- void SetShape (std::string shape) { shape_ = shape; }
144-
145- virtual std::string GetShape (hipGraphDebugDotFlags flag) { return shape_; }
146-
147- void SetLabel (std::string label) { label_ = label; }
141+ virtual const char * GetShape (hipGraphDebugDotFlags flag) { return shape_; }
148142
149143 virtual std::string GetLabel (hipGraphDebugDotFlags flag) { return label_; }
150144
@@ -191,8 +185,8 @@ class GraphKernelArgManager : public amd::ReferenceCountedObject,
191185
192186class GraphNode : public hipGraphNodeDOTAttribute {
193187 public:
194- GraphNode (hipGraphNodeType type, std::string style = " " , std::string shape = " " ,
195- std::string label = " " )
188+ GraphNode (hipGraphNodeType type, const char * style = " " , const char * shape = " " ,
189+ const char * label = " " )
196190 : type_(type),
197191 visited_ (false ),
198192 inDegree_(0 ),
@@ -956,7 +950,7 @@ class GraphKernelNode : public GraphNode {
956950 " handle | func handle} | {%p | %p}}\n | {accessPolicyWindow | {base_ptr | num_bytes | "
957951 " hitRatio | hitProp | missProp} | {%p | %zu | %f | %d | %d}}\n | {cooperative | "
958952 " %u}\n | {priority | %d}\n }" ,
959- label_. c_str () , GetID (), function->name ().c_str (), kernelParams_.gridDim .x ,
953+ label_, GetID (), function->name ().c_str (), kernelParams_.gridDim .x ,
960954 kernelParams_.gridDim .y , kernelParams_.gridDim .z , kernelParams_.blockDim .x ,
961955 kernelParams_.blockDim .y , kernelParams_.blockDim .z ,
962956 kernelParams_.sharedMemBytes , this , kernelParams_.func ,
@@ -972,7 +966,7 @@ class GraphKernelNode : public GraphNode {
972966 " | {accessPolicyWindow | {base_ptr | num_bytes | "
973967 " hitRatio | hitProp | missProp} |\n | {%p | %zu | %f | %d | %d}}\n | {cooperative | "
974968 " %u}\n | {priority | %d}\n }" ,
975- label_. c_str () , GetID (), function->name ().c_str (),
969+ label_, GetID (), function->name ().c_str (),
976970 kernelAttr_.accessPolicyWindow .base_ptr , kernelAttr_.accessPolicyWindow .num_bytes ,
977971 kernelAttr_.accessPolicyWindow .hitRatio , kernelAttr_.accessPolicyWindow .hitProp ,
978972 kernelAttr_.accessPolicyWindow .missProp , kernelAttr_.cooperative ,
@@ -993,7 +987,7 @@ class GraphKernelNode : public GraphNode {
993987 return label;
994988 }
995989
996- std::string GetShape (hipGraphDebugDotFlags flag) override {
990+ const char * GetShape (hipGraphDebugDotFlags flag) override {
997991 if (flag == hipGraphDebugDotFlagsKernelNodeParams || flag == hipGraphDebugDotFlagsVerbose) {
998992 return " record" ;
999993 } else {
@@ -1471,7 +1465,7 @@ class GraphMemcpyNode : public GraphNode {
14711465 " | %zu}}\n | {{srcPos | {{x | %zu} | {y | %zu} | {z | %zu}}} | {dstPos | {{x | %zu} | {y "
14721466 " | "
14731467 " %zu} | {z | %zu}}} | {Extent | {{Width | %zu} | {Height | %zu} | {Depth | %zu}}}}\n }" ,
1474- label_. c_str () , GetID (), this , memcpyDirection.c_str (), copyParams_.srcPtr .pitch ,
1468+ label_, GetID (), this , memcpyDirection.c_str (), copyParams_.srcPtr .pitch ,
14751469 copyParams_.srcPtr .ptr , copyParams_.srcPtr .xsize , copyParams_.srcPtr .ysize ,
14761470 copyParams_.dstPtr .pitch , copyParams_.dstPtr .ptr , copyParams_.dstPtr .xsize ,
14771471 copyParams_.dstPtr .ysize , copyParams_.srcPos .x , copyParams_.srcPos .y ,
@@ -1484,7 +1478,7 @@ class GraphMemcpyNode : public GraphNode {
14841478 }
14851479 return label;
14861480 }
1487- std::string GetShape (hipGraphDebugDotFlags flag) override {
1481+ const char * GetShape (hipGraphDebugDotFlags flag) override {
14881482 if (flag == hipGraphDebugDotFlagsMemcpyNodeParams || flag == hipGraphDebugDotFlagsVerbose) {
14891483 return " record" ;
14901484 } else {
@@ -1678,7 +1672,7 @@ class GraphMemcpyNode1D : public GraphMemcpyNode {
16781672 " | %zu}}\n | {{srcPos | {{x | %zu} | {y | %zu} | {z | %zu}}} | {dstPos | {{x | %zu} | {y "
16791673 " | "
16801674 " %zu} | {z | %zu}}} | {Extent | {{Width | %zu} | {Height | %zu} | {Depth | %zu}}}}\n }" ,
1681- label_. c_str () , GetID (), this , memcpyDirection.c_str (), (size_t )0 , src_, (size_t )0 ,
1675+ label_, GetID (), this , memcpyDirection.c_str (), (size_t )0 , src_, (size_t )0 ,
16821676 (size_t )0 , (size_t )0 , dst_, (size_t )0 , (size_t )0 , (size_t )0 , (size_t )0 , (size_t )0 ,
16831677 (size_t )0 , (size_t )0 , (size_t )0 , count_, (size_t )1 , (size_t )1 );
16841678 label = buffer;
@@ -1688,7 +1682,7 @@ class GraphMemcpyNode1D : public GraphMemcpyNode {
16881682 }
16891683 return label;
16901684 }
1691- std::string GetShape (hipGraphDebugDotFlags flag) override {
1685+ const char * GetShape (hipGraphDebugDotFlags flag) override {
16921686 if (flag == hipGraphDebugDotFlagsMemcpyNodeParams || flag == hipGraphDebugDotFlagsVerbose) {
16931687 return " record" ;
16941688 } else {
@@ -1945,7 +1939,7 @@ class GraphMemsetNode : public GraphNode {
19451939 sprintf (buffer,
19461940 " {\n %s\n | {{ID | node handle | dptr | pitch | value | elementSize | width | "
19471941 " height | depth} | {%u | %p | %p | %zu | %u | %u | %zu | %zu | %zu}}}" ,
1948- label_. c_str () , GetID (), this , memsetParams_.dst , memsetParams_.pitch ,
1942+ label_, GetID (), this , memsetParams_.dst , memsetParams_.pitch ,
19491943 memsetParams_.value , memsetParams_.elementSize , memsetParams_.width ,
19501944 memsetParams_.height , depth_);
19511945 label = buffer;
@@ -1962,7 +1956,7 @@ class GraphMemsetNode : public GraphNode {
19621956 return label;
19631957 }
19641958
1965- std::string GetShape (hipGraphDebugDotFlags flag) override {
1959+ const char * GetShape (hipGraphDebugDotFlags flag) override {
19661960 if (flag == hipGraphDebugDotFlagsMemsetNodeParams || flag == hipGraphDebugDotFlagsVerbose) {
19671961 return " record" ;
19681962 } else {
0 commit comments