[llvm] [Offload] Introduce ATTACH map-type support for pointer attachment. (PR #149036)

Abhinav Gaba via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 13 12:53:48 PDT 2025


================
@@ -2538,6 +2538,10 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
                                           getAgent(), (uint64_t)Size);
   }
 
+  Error dataFence(__tgt_async_info *Async) override {
----------------
abhinavgaba wrote:

Highlighting the previous comment regarding that for reference:

>@adurang added the plugin changes, so he can probably clarify, but the implementation of dataFence is supposed to vary from device to device. For example, if a device supports device-side barriers, then such a barrier can be inserted into its data-transfer queue, so that anything that precedes it happens before anything after the fence.
>
>For devices that do in-order data-transfers by default, this is a no-op, hence, the dataFence simply returns.
>
>But if a device supports out-of-order data-transfers, then it should be implemented for that device, with whichever mechanism the device supports.
>
>If you think the plugin changes are better off in a separate PR, then Alex can help create one, and we can rebase this once the plugins PR is merged.

The empty/no-op definition of `dataFence` should be the full and final implementation of the function for devices that do in-order transfers. It's supposed to be functional only on devices that support out-of-order transfers. (Maybe that can be clarified via some comments.)

Or, theoretically, if a `Device` internally uses multiple independent queues for issuing `submitData` calls in parallel despite sharing the same `AsyncInfo` object (which I'm not aware happens with any device).

And as mentioned earlier, if you think the plugin changes are better off in a separate PR, then @adurang can help create one, and we can rebase this once the plugins PR is merged.

https://github.com/llvm/llvm-project/pull/149036


More information about the llvm-commits mailing list