nlcpy.prof.ftrace_region

nlcpy.prof.ftrace_region(message)[source]

Enables profiling with an ftrace region during ‘with’ statement.

A file ftrace.out is generated after running your program that invokes this routine. The ftrace.out includes performance information of your program.

Parameters
messagestr

Any string can be specified to distinguish a user-specified region.

See also

ftrace_region_begin

Begins ftrace region.

ftrace_region_end

Ends ftrace region.

Examples

>>> import nlcpy as vp
>>> x = vp.random.rand(10000, 10000)
>>> with vp.prof.ftrace_region('dgemm'):
...     # something you want to profile
...     _ = x @ x