AbandonCache
Function Usage
Disables the aclnn cache function.
After an aclnn operator is called for the first time, the framework records the cache. When the aclnn operator is called again, the aclnnXxxGetWorkspaceSize function is skipped. This helps to optimize the performance.
Prototype
void AbandonCache(bool disableRepeat = false)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
disableRepeat |
Input |
Whether aclOpExecutor can be reused. The default value is false, indicating that it is not reused. |
Returns
None
Constraints
If the aclnnXxxGetWorkspaceSize function must be executed in the first phase, AbandonCache needs to be explicitly called in this function.
Example
1 2 3 4 5 | void aclnnAddGetWorkspaceSize(..., uint64_t *workspaceSize, aclOpExecutor **executor) { auto uniqueExecutor = CREATE_EXECUTOR(); ...... uniqueExecutor.get()->AbandonCache(); } |
Parent topic: op_executor