File indexing completed on 2026-11-07 10:21:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef __TBB_numa_allocation_H
0018 #define __TBB_numa_allocation_H
0019
0020 #include "detail/_config.h"
0021 #if !__TBB_PREVIEW_NUMA_ALLOCATION
0022 #error Set TBB_PREVIEW_NUMA_ALLOCATION to include numa_allocation.h
0023 #endif
0024
0025 #include "info.h"
0026
0027 namespace tbb {
0028 namespace detail {
0029
0030 namespace r1 {
0031
0032 TBB_EXPORT void *__TBB_EXPORTED_FUNC allocate_interleaved(size_t bytes,
0033 const tbb::detail::d1::numa_node_id *nodes, size_t nodes_count, size_t bytes_per_chunk);
0034 TBB_EXPORT void __TBB_EXPORTED_FUNC deallocate_interleaved(void *ptr, size_t bytes);
0035
0036 }
0037
0038 namespace d1 {
0039
0040 inline void *allocate_numa_interleaved(size_t bytes,
0041 const std::vector<tbb::numa_node_id>& nodes,
0042 size_t bytes_per_chunk = 0) {
0043 if (nodes.empty())
0044 return nullptr;
0045 return r1::allocate_interleaved(bytes, nodes.data(), nodes.size(), bytes_per_chunk);
0046 }
0047
0048 inline void *allocate_numa_interleaved(size_t bytes, size_t bytes_per_chunk = 0) {
0049 return r1::allocate_interleaved(bytes, nullptr, 0, bytes_per_chunk);
0050 }
0051
0052 inline void deallocate_numa_interleaved(void *ptr, size_t bytes) {
0053 r1::deallocate_interleaved(ptr, bytes);
0054 }
0055
0056 }
0057 }
0058
0059 inline namespace v1 {
0060 using detail::d1::allocate_numa_interleaved;
0061 using detail::d1::deallocate_numa_interleaved;
0062 }
0063
0064 }
0065
0066 #endif