Add `TraceCollector::IsEnabled(bool)` method in order to test when tracing is enabled.
Some builds install a `TraceCollector` at process startup, but it is mostly not enabled. This inhibits the recent optimization to avoid accessing `OpKernel::name()` and `OpKernel::type_string()` every time a kernel is launched. By caching the `TraceCollector` in the `TracingDevice` and adding a method to enquire about its state, we increase the applicability of the optimization. PiperOrigin-RevId: 211752728
Loading
Please sign in to comment