llvm-project/openmp/libomptarget/include
Joseph Huber 23bc343855 [Libomptarget] Change device free routines to accept the allocation kind
Previous support for device memory allocators used a single free
routine and did not provide the original kind of the allocation. This is
problematic as some of these memory types required different handling.
Previously this was worked around using a map in runtime to record the
original kind of each pointer. Instead, this patch introduces new free
routines similar to the existing allocation routines. This allows us to
avoid a map traversal every time we free a device pointer.

The only interfaces defined by the standard are `omp_target_alloc` and
`omp_target_free`, these do not take a kind as `omp_alloc` does. The
standard dictates the following:

"The omp_target_alloc routine returns a device pointer that references
the device address of a storage location of size bytes. The storage
location is dynamically allocated in the device data environment of the
device specified by device_num."

Which suggests that these routines only allocate the default device
memory for the kind. So this has been changed to reflect this. This
change is somewhat breaking if users were using `omp_target_free` as
previously shown in the tests.

Reviewed By: JonChesterfield, tianshilei1992

Differential Revision: https://reviews.llvm.org/D133053
2022-09-14 12:14:07 -05:00
..
Debug.h [Libomptarget] Remove old workaround for GCC 5,6 from libomptarget 2022-08-30 19:13:48 -05:00
DeviceEnvironment.h [libomptarget] Move device environment to shared header, remove divergence 2021-10-07 12:03:48 +01:00
ExclusiveAccess.h [OpenMP][FIX] Repair ExclusiveAccess move semantic snafu 2022-03-25 16:00:53 -05:00
SourceInfo.h [Libomptarget] Use entry name for global info 2022-04-25 09:56:43 -04:00
device.h [Libomptarget] Change device free routines to accept the allocation kind 2022-09-14 12:14:07 -05:00
dlwrap.h [nfc][openmp] Swap arguments to remove noise from upcoming diff 2022-03-11 23:08:37 +00:00
interop.h Runtime for Interop directive 2022-01-27 15:16:24 -05:00
omptarget.h [Libomptarget] Change device free routines to accept the allocation kind 2022-09-14 12:14:07 -05:00
omptargetplugin.h [Libomptarget] Change device free routines to accept the allocation kind 2022-09-14 12:14:07 -05:00
rtl.h [Libomptarget] Change device free routines to accept the allocation kind 2022-09-14 12:14:07 -05:00