Start a named profiling region
If nvtx_only is true, the region only appears in NVTX timeline, not in the text report from profiler_report().
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name | |||
| logical, | intent(in), | optional | :: | nvtx_only |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=default_int), | private | :: | idx |
subroutine profiler_start(name, nvtx_only) !! Start a named profiling region !! !! If nvtx_only is true, the region only appears in NVTX timeline, !! not in the text report from profiler_report(). character(len=*), intent(in) :: name logical, intent(in), optional :: nvtx_only integer(default_int) :: idx #ifdef PIC_DISABLE_PROFILER return #endif if (.not. state%enabled) return idx = find_or_create_region(name) if (idx < 0) return ! Don't start if already active (nested calls to same region) if (state%regions(idx)%active) return if (present(nvtx_only) .and. state%regions(idx)%call_count == 0) then state%regions(idx)%nvtx_only = nvtx_only end if state%regions(idx)%active = .true. call nvtx_range_push(name) call state%regions(idx)%timer%start() ! Push onto stack for stack-based stop state%stack_depth = state%stack_depth + 1 state%stack(state%stack_depth) = idx end subroutine profiler_start