[llvm] WIP: [Offload] Implement olMemFill (PR #154102)

Callum Fare via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 18 07:37:49 PDT 2025


================
@@ -2583,6 +2583,30 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
     return Plugin::success();
   }
 
+  Error dataFillImpl(void *TgtPtr, const void *PatternPtr, int64_t PatternSize,
+                     int64_t Size,
+                     AsyncInfoWrapperTy &AsyncInfoWrapper) override {
+    hsa_status_t Status;
+
+    // We can use hsa_amd_memory_fill for this size, but it's not async so the
+    // queue needs to be synchronized first
+    if (PatternSize == 4) {
+      if (AsyncInfoWrapper.hasQueue())
+        if (auto Err = synchronize(AsyncInfoWrapper))
+          return Err;
+      Status = hsa_amd_memory_fill(TgtPtr, *(uint32_t *)(TgtPtr),
----------------
callumfare wrote:

Good catch. `olMemFillTest.Success32` should pass on AMD now

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


More information about the llvm-commits mailing list