Moving this method helps eliminate a use of g_atl_machine.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Moving the function is good, nice that we don't have to re-assemble the list of agents. The change to Malloc is (probably, I haven't checked all the call sites) correct but will make it easy to forget the register call in a later change, so I think we want to route all calls through HostMalloc and DeviceMalloc and make Runtime::Malloc harder to call by accident, e.g. scope it to the file and rename it MallocImpl or similar
openmp/libomptarget/plugins/amdgpu/impl/data.cpp | ||
---|---|---|
66 | it's not obvious this is dead - if Runtime::Malloc is called with DEVTYPE_CPU, but not from HostMalloc (where the follow on handling is added), then we miss the allow_access call. Can this Runtime::Malloc be made local to this TU, so that we can't accidentally call it instead of one of the DeviceMalloc or HostMalloc wrappers? | |
openmp/libomptarget/plugins/amdgpu/impl/system.cpp | ||
940 | this was dead because it passes DEVTYPE_GPU which register_allocation ignores |
openmp/libomptarget/plugins/amdgpu/impl/data.cpp | ||
---|---|---|
66 | Malloc is already declared inside Runtime class as private static method. |
Ah yes, so it is. Not sure we're getting much value from the static member functions in rt.h, relative to the free functions found elsewhere, but that's unrelated to this change.
it's not obvious this is dead - if Runtime::Malloc is called with DEVTYPE_CPU, but not from HostMalloc (where the follow on handling is added), then we miss the allow_access call. Can this Runtime::Malloc be made local to this TU, so that we can't accidentally call it instead of one of the DeviceMalloc or HostMalloc wrappers?