MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / EventName

Function EventName

tensorflow/core/profiler/lib/profiler_session.cc:45–64  ·  view source on GitHub ↗

Given a node_name in the format "op_name:op_type", returns the "op_type". If the "op_type" is missing, returns the node_name. This is done so all ops with the same type appear in the same color in trace viewer.

Source from the content-addressed store, hash-verified

43// This is done so all ops with the same type appear in the same color in trace
44// viewer.
45inline std::string EventName(absl::string_view node_name) {
46 // NOTE: open source device tracer now append cupti kernel name after
47 // annotation as node_name, @@ is used as separator. kernel name is
48 // demangled and possibly contains "::" patterns.
49 std::vector<absl::string_view> segments = absl::StrSplit(node_name, "@@");
50 if (segments.size() > 1) { // unparsed
51 // find the last annotation.
52 std::vector<absl::string_view> annotation_stack =
53 absl::StrSplit(segments.front(), "::");
54 // strip trace argument.
55 std::vector<absl::string_view> annotation_parts =
56 absl::StrSplit(annotation_stack.back(), '#');
57 std::vector<absl::string_view> parts =
58 absl::StrSplit(annotation_parts.front(), ':');
59 return std::string(parts.back());
60 } else {
61 std::vector<absl::string_view> parts = absl::StrSplit(node_name, ':');
62 return std::string(parts.back());
63 }
64}
65
66void AssignLanes(RunMetadata* run_metadata) {
67 for (size_t device_id = 0;

Callers 1

Calls 3

sizeMethod · 0.45
frontMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected