| 156 | }; |
| 157 | |
| 158 | void omp_allocator::raw_free(void *mem) { |
| 159 | #ifdef LIB_NUMA_AVAILABLE |
| 160 | { |
| 161 | std::lock_guard<std::mutex> lock(numa_amap_mutex); |
| 162 | numa_amap_t& numa_amap = get_numa_allocation_map(); |
| 163 | if(auto node = numa_amap.extract(mem)){ |
| 164 | size_t size_bytes = node.mapped(); |
| 165 | numa_free(mem, size_bytes); |
| 166 | return; |
| 167 | } |
| 168 | } |
| 169 | #endif // LIB_NUMA_AVAILABLE |
| 170 | |
| 171 | #if !defined(_WIN32) |
| 172 | std::free(mem); |
| 173 | #else |
| 174 | _aligned_free(mem); |
| 175 | #endif |
| 176 | } |
| 177 | |
| 178 | void* omp_allocator::raw_allocate_usm(size_t bytes, |
| 179 | const allocation_hints &hints) { |