pyACL API扩展接口采集性能数据

为了获取用户和上层框架程序的性能数据,Profiling开启msproftx功能之前,需要在程序内调用msproftx相关接口(Profiling pyACL API扩展接口)来对用户程序进行打点以输出对应的性能数据。

Profiling pyACL API扩展接口

表1 Profiling pyACL API扩展接口

接口

说明

acl.prof.create_stamp

创建msproftx事件标记,用于描述瞬时事件。

acl.prof.set_stamp_trace_message

为msproftx事件标记携带描述信息,在Profiling解析结果中msprof_tx summary数据展示。

acl.prof.mark

msproftx标记瞬时事件。

acl.prof.push

msproftx用于记录事件发生的时间跨度的开始时间。与acl.prof.pop成对使用,仅能在单线程内使用。

acl.prof.pop

msproftx用于记录事件发生的时间跨度的结束时间。与acl.prof.push成对使用,仅能在单线程内使用。

acl.prof.range_start

msproftx用于记录事件发生的时间跨度的开始时间。与acl.prof.range_stop成对使用,可跨线程使用。

acl.prof.range_stop

msproftx用于记录事件发生的时间跨度的结束时间。与acl.prof.range_start成对使用,可跨线程使用。

acl.prof.destroy_stamp

释放msproftx事件标记。

Profiling pyACL API扩展接口调用示例

Profiling msproftx接口,示例如下加粗部分代码。

Profiling AscendCL API扩展接口在main函数内调用。