When invoking a kernel function, we pass arguments and offsets to plugin for now.
In each plugin, it recalculates the real argument by adding offsets to arguments.
We can actually move this part to libomptarget.
We need to keep bases and offsets separate. Sometimes (e.g. in OpenCL) we need to manifest base pointers prior to launching a kernel. Even if you have mapped an object only partially, e.g. A[N:M], although the kernel is expected to access elements starting at address &A[N] and beyond, we still need to manifest the base of the array &A. In other cases, e.g. the COI API, need the begin address itself, i.e. &A[N] as the API operates on begin addresses, not bases. That's why we pass args and offsets as two separate entities so that each plugin can do what it needs. What you are trying to do with this patch is to revert https://reviews.llvm.org/D33028.
I see. Thanks for the information. We don't support the case you mentioned in current repo, right? I did check all uses of the offsets in current repo, but looks like they just add them up everywhere.