================
@@ -624,32 +622,15 @@ Error olMemAlloc_impl(ol_device_handle_t Device,
ol_alloc_type_t Type,
return Alloc.takeError();
*AllocationOut = *Alloc;
- {
- std::lock_guard<std::mutex> Lock(OffloadContext::get().AllocInfoMapMutex);
- OffloadContext::get().AllocInfoMap.insert_or_assign(
- *Alloc, AllocInfo{Device, Type});
- }
return Error::success();
}
Error olMemFree_impl(ol_platform_handle_t Platform, void *Address) {
- ol_device_handle_t Device;
- ol_alloc_type_t Type;
- {
- std::lock_guard<std::mutex> Lock(OffloadContext::get().AllocInfoMapMutex);
- if (!OffloadContext::get().AllocInfoMap.contains(Address))
- return createOffloadError(ErrorCode::INVALID_ARGUMENT,
- "address is not a known allocation");
-
- auto AllocInfo = OffloadContext::get().AllocInfoMap.at(Address);
- Device = AllocInfo.Device;
- Type = AllocInfo.Type;
- OffloadContext::get().AllocInfoMap.erase(Address);
- }
- assert(Platform == Device->Platform);
+ auto MemInfo = Platform->Plugin->get_memory_info(Address);
----------------
arsenm wrote:
No auto
https://github.com/llvm/llvm-project/pull/157484
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits