Lines Matching full:map
93 // instead we need to keep an extra map to keep track of them
107 map_type map{}; member in MemoryMap
127 PetscCall(map.reserve(16)); in register_finalize_()
134 PetscCall(PetscInfo(nullptr, "Finalizing memory map\n")); in finalize_()
135 PetscCallCXX(map = map_type{}); in finalize_()
144 MemoryMap::search_for - retrieve an iterator to the key-value pair for a pointer in the map
154 If ptr is not found and must_find is false returns map.end(), otherwise raises an error
158 const auto end_it = map.end(); in search_for()
159 auto it = map.find(const_cast<map_type::key_type>(ptr)); in search_for()
166 it = std::find_if(map.begin(), end_it, [ptr](map_type::const_iterator::reference map_it) { in search_for()
189 // the map again we just return it here
192 auto &map = memory_map.map; in PetscDeviceRegisterMemory_Private() local
196 if (it == map.cend()) { in PetscDeviceRegisterMemory_Private()
197 // pointer was never registered with the map, insert it and bail in PetscDeviceRegisterMemory_Private()
203 for (const auto &entry : map) { in PetscDeviceRegisterMemory_Private()
213 PetscCallCXX(map.emplace( in PetscDeviceRegisterMemory_Private()
395 auto &map = memory_map.map; in PetscDeviceDeallocate_Private() local
396 const auto found_it = map.find(const_cast<MemoryMap::map_type::key_type>(ptr)); in PetscDeviceDeallocate_Private()
398 if (PetscUnlikelyDebug(found_it == map.end())) { in PetscDeviceDeallocate_Private()
402 // if it is map.cend() then no allocation owns it, meaning it was not allocated by us! in PetscDeviceDeallocate_Private()
403 …PetscCheck(it != map.cend(), PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Pointer %p was not allocated v… in PetscDeviceDeallocate_Private()
426 PetscCallCXX(map.erase(found_it)); in PetscDeviceDeallocate_Private()