| 190 | } // namespace |
| 191 | |
| 192 | void 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 | |
| 209 | string GetNodeExecutionRangeMessageImpl( |
| 210 | const OpKernel* kernel, |
no test coverage detected