aclrtCacheLastTaskOpInfo
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
X |
|
√ |
|
X |
Description
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:
- Call aclmdlRICaptureBegin to start the capture task.
- Call aclrtSetStreamAttribute to enable operator information caching.
- Deliver an operator execution task, for example, by calling aclrtLaunchKernelWithConfig.
- 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.
- Call aclrtCacheLastTaskOpInfo to cache the operator information.
- Call aclrtSetStreamAttribute again to disable operator information caching.
- Call aclmdlRICaptureEnd to end the capture task.
- After performance data collection is enabled (by calling the APIs in Data Profiling APIs), call aclmdlRIExecuteAsync to run inference.
During this process, the collected performance data contains operator information.
- Finally, when aclmdlRIDestroy is called to destroy the model running instance, the cached operator information is also released.