compute-runtime/opencl/source/context
Maciej Bielski c7a971a28f feature: add optional onChunkFree callback to AbstractBuffersPool
Instances returned by `getAllocationsVector()` in some cases cannot be
freed (in the `malloc/new` sense) until the `drain()` function invokes
`allocInUse()` on them. Plus, the `chunksToFree` container operates on
pairs `{offset, size}`, not pointers, so such pair cannot be used to
release allocations either.

Provide an optional callback, which can be implemented by the custom
pool derived from `AbstractBuffersPool`. This callback can be used, for
example, to perform actual release of an allocation related to the
currently processed chunk.

Additionally, provide the `drain()` and `tryFreeFromPoolBuffer()`
functions with pool-independent versions and keep the previous versions
as defaults (for allocators with a single pool). The new versions allow
reusing the code for cases when allocator has multiple pools.

In both cases, there was no such needs so far but it arose when working
on `IsaBuffersAllocator`. The latter is coming with future commits, but
the shared code modifications are extracted as an independent step.

Related-To: NEO-7788
Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
2023-07-13 17:26:51 +02:00
..
CMakeLists.txt Prepare for pool buffer enabling 1/n 2022-12-05 23:51:30 +01:00
context.cpp feature: add optional onChunkFree callback to AbstractBuffersPool 2023-07-13 17:26:51 +02:00
context.h refactor: extract generic parts of small buffers allocator 2023-06-13 10:46:03 +02:00
context.inl Copyright header update 2021-05-17 20:38:19 +02:00
context_type.h
driver_diagnostics.cpp style: format code using clang-format 15.0.6 2023-01-05 10:33:47 +01:00
driver_diagnostics.h Update OCL headers 2022-06-23 17:07:16 +02:00
pool_buffer_additional_checks.cpp Prepare for pool buffer enabling 1/n 2022-12-05 23:51:30 +01:00