Profiling

time range

cupy.prof.TimeRangeDecorator(message=None, color_id=None, argb_color=None)[source]

Decorator to mark function calls with range in NVIDIA profiler

Decorated function calls are marked as ranges in NVIDIA profiler timeline.

>>> from cupy import prof
>>> @cupy.prof.TimeRangeDecorator()
... def function_to_profile():
...     pass
Parameters:
  • message (str) – Name of a range, default use func.__name__.
  • color_id – range color ID
  • argb_color – range color in ARGB (e.g. 0xFF00FF00 for green)
cupy.prof.time_range(message, color_id=None, argb_color=None)[source]

A context manager to describe the enclosed block as a nested range

>>> from cupy import prof
>>> with cupy.prof.time_range('some range in green', color_id=0):
...    # do something you want to measure
...    pass
Parameters:
  • message – Name of a range.
  • color_id – range color ID
  • argb_color – range color in ARGB (e.g. 0xFF00FF00 for green)