aclrtCacheLastTaskOpInfo
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
☓ |
|
☓ |
|
☓ |
Description
Caches the operator information in the specified memory to the last delivered task in the current thread based on the infoSize when a model running instance is built in the capture mode.
Prototype
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; else, failure. For details, see aclError.
API Call Sequence
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 task capture.
- After performance data collection is enabled (by calling the APIs in Profiling Data Collection 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 operator cache information is also released.