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

Function MakeAttributes

tensorflow/core/profiler/nvtx_utils.cc:192–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190} // namespace
191
192void MakeAttributes(const char* msg, absl::string_view category,
193 nvtxEventAttributes_t* result) {
194 *result = {};
195 result->version = NVTX_VERSION;
196 result->size = NVTX_EVENT_ATTRIB_STRUCT_SIZE;
197 result->messageType = NVTX_MESSAGE_TYPE_ASCII;
198 result->message.ascii = msg;
199 if (detail::RangesColorEnabled() && !category.empty()) {
200 size_t hash = detail::hash_bytes(category.data(), category.size());
201 uint32_t color = detail::get_color(hash);
202 uint32_t category = static_cast<uint32_t>(hash);
203 result->colorType = NVTX_COLOR_ARGB;
204 result->color = color;
205 result->category = category;
206 }
207}
208
209string GetNodeExecutionRangeMessageImpl(
210 const OpKernel* kernel,

Callers 2

ScopedRangeIfEnabledMethod · 0.85
resetMethod · 0.85

Calls 6

RangesColorEnabledFunction · 0.85
hash_bytesFunction · 0.85
get_colorFunction · 0.85
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected