diff --git a/libs/core/allocator_support/CMakeLists.txt b/libs/core/allocator_support/CMakeLists.txt index 1e5bcb0f10a..07f9bb77f40 100644 --- a/libs/core/allocator_support/CMakeLists.txt +++ b/libs/core/allocator_support/CMakeLists.txt @@ -42,7 +42,7 @@ set(allocator_support_compat_headers ) # cmake-format: on -set(allocator_support_sources) +set(allocator_support_sources thread_local_caching_allocator.cpp) include(HPX_AddModule) add_hpx_module( diff --git a/libs/core/allocator_support/include/hpx/allocator_support/thread_local_caching_allocator.hpp b/libs/core/allocator_support/include/hpx/allocator_support/thread_local_caching_allocator.hpp index 0afd89a7c3f..af8759a7e70 100644 --- a/libs/core/allocator_support/include/hpx/allocator_support/thread_local_caching_allocator.hpp +++ b/libs/core/allocator_support/include/hpx/allocator_support/thread_local_caching_allocator.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -21,9 +22,18 @@ namespace hpx::util { !((defined(HPX_HAVE_CUDA) && defined(__CUDACC__)) || \ defined(HPX_HAVE_HIP)) + namespace detail { + + HPX_CORE_EXPORT void init_allocator_cache( + std::function&& clear_cache); + HPX_CORE_EXPORT std::pair + allocate_from_cache() noexcept; + HPX_CORE_EXPORT [[nodiscard]] bool cache_empty() noexcept; + HPX_CORE_EXPORT void return_to_cache(void* p, std::size_t n) noexcept; + } // namespace detail + /////////////////////////////////////////////////////////////////////////// - template