Manually manages or reuses the physical memory of the unified buffer/L1 buffer. It is mainly used when the physical memory of the unified buffer/L1 buffer is insufficient in multi-stage computing.
The following figure shows the resource pool division process.
TPipe::InitBuffer can allocate buffers and manage buffers by using queues.
TPipe::InitBufPool can divide the resource pool BufPool1.
TPipe::InitBufPool can specify the addresses and lengths of BufPool1 and BufPool3 for reuse.
TBufPool::InitBuffer and TBufPool::InitBufPool divide BufPool1 and BufPool3 into buffer or TBufPool resource pools.
Figure 1 BufPool resource pool division

As shown in the preceding figure, the outer TBufPool (BufPool1 and BufPool3) needs to be allocated and initialized through TPipe::InitBufPool, and the inner TBufPool (BufPool2) can be allocated and initialized through TBufPool::InitBufPool.
TBufPool must be divided and initialized by calling TPipe::InitBufPool or TBufPool::InitBufPool. A resource pool can only be divided into parts, but cannot be combined into a whole.
When different TBufPool resource pools are switched for computation, TBufPool::Reset() needs to be called to clear TBufPool that has been computed. The cleared TBufPool resource pool, allocated buffers, and data are invalid by default.
Buffers allocated by different resource pools cannot be used together to avoid data corruption.
Alloc/Free and EnQue/DeQue must be used in pairs to split a TBufPool resource pool to ensure automatic synchronization.
When the resource pool is switched, handwriting synchronization may cause Ascend C address read/write and reuse asynchronization. Therefore, handwriting synchronization is not recommended.