cupy.prof.time_range#

cupy.prof.time_range(message, color_id=None, argb_color=None, sync=False)[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)

  • sync (bool) – If True, waits for completion of all outstanding processing on GPU before calling cupy.cuda.nvtx.RangePush() or cupy.cuda.nvtx.RangePop()

Warning

This context manager is deprecated. Please use cupyx.profiler.time_range instead.