aclrtCacheLastTaskOpInfo

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

X

Atlas inference products

√

Atlas training products

X

Function

Caches the operator information in the specified memory to the last delivered task in the current thread based on infoSize when a model running instance is built in the capture mode.

Prototype

1
aclError aclrtCacheLastTaskOpInfo(const void * const infoPtr, const size_t infoSize)

Parameters

Parameter

Input/Output

Description

infoPtr

Input

Pointer to the memory address of the cached information (host memory).

infoSize

Input

Size of the memory for caching information, in bytes. The value range is (0, 64K].

Returns

0 on success; otherwise, failure. For details, see aclError.

API Calling Process

This API must be used together with the following key APIs to specify whether to include operator information when collecting performance data:

  1. Call aclmdlRICaptureBegin to start capturing tasks.
  2. Call aclrtSetStreamAttribute to enable operator information caching.
  3. Deliver an operator execution task, for example, by calling aclrtLaunchKernelWithConfig.
  4. Call aclrtGetStreamAttribute to check whether operator information caching is enabled.

    Only when operator information caching is enabled (by calling aclrtSetStreamAttribute) in the capture state, the aclrtGetStreamAttribute API can be used to obtain the status of the operator information caching function and the operator information can be cached.

  5. Call aclrtCacheLastTaskOpInfo to cache the operator information.
  6. Call aclrtSetStreamAttribute again to disable operator information caching.
  7. Call aclmdlRICaptureEnd to end the capture action.
  8. After performance data collection is enabled (by calling the APIs in Profiling APIs), call aclmdlRIExecuteAsync to run inference.

    During this process, the collected performance data contains operator information.

  9. Finally, call aclmdlRIDestroy to destroy the model running instance. The cached operator information is also released.