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

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

Profiling AscendCL API扩展接口

表1 Profiling AscendCL API扩展接口

接口

说明

aclprofCreateStamp

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

aclprofSetStampTraceMessage

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

aclprofMark

msproftx标记瞬时事件。

aclprofPush

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

aclprofPop

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

aclprofRangeStart

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

aclprofRangeStop

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

aclprofDestroyStamp

释放msproftx事件标记。

当只开启msproftx功能时,aclCreateProfConfig接口的deviceIdList参数值需设为空,deviceNums参数值设为0。

Profiling AscendCL API扩展接口调用示例

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

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