A helper function to decide whether to enable CUDA NVTX profiling ranges.
| 33 | |
| 34 | // A helper function to decide whether to enable CUDA NVTX profiling ranges. |
| 35 | inline bool RangesEnabled() { |
| 36 | static bool is_enabled = [] { |
| 37 | bool _is_enabled = false; |
| 38 | TF_CHECK_OK(tensorflow::ReadBoolFromEnvVar("TF_ENABLE_NVTX_RANGES", |
| 39 | /*default_val=*/false, |
| 40 | &_is_enabled)); |
| 41 | return _is_enabled; |
| 42 | }(); |
| 43 | return is_enabled; |
| 44 | } |
| 45 | |
| 46 | // Note: The memory backing msg must persist until the result of this function |
| 47 | // has been consumed by an NVTX API. |
no test coverage detected