[llvm] [Offload] Have olMemFree accept a platform as a param (PR #157478)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 17 06:57:45 PDT 2025
https://github.com/jhuber6 commented:
I would still really prefer if we didn't need to change the free interface. As far as I understand, the general problem is that when we start working with heterogeneous devices, we could have two devices that return the same address and thus confound our attempts to map pointers to devices.
The only time this can occur is for allocations on the device itself, managed allocations will go through the shared Linux kernel. If I understand correctly, after allocation we will put something into some kind of map. If we already have a map, then we should be able to detect if there is a conflict. If there is a conflict, we should just allocate the memory again, try adding it again, then free the old pointer. It's slightly inefficient, but this is a one in a million edge case, it does not need to be fast. Does this make sense to you?
https://github.com/llvm/llvm-project/pull/157478
More information about the llvm-commits
mailing list