Skip to content

Conversation

@callumfare
Copy link
Contributor

No description provided.

@llvmbot llvmbot added the offload label Jun 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2025

@llvm/pr-subscribers-offload

Author: Callum Fare (callumfare)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/143161.diff

2 Files Affected:

  • (modified) offload/liboffload/API/Memory.td (+1-1)
  • (modified) offload/liboffload/src/OffloadImpl.cpp (+1-1)
diff --git a/offload/liboffload/API/Memory.td b/offload/liboffload/API/Memory.td
index 9cd1ef6362e15..029975c448295 100644
--- a/offload/liboffload/API/Memory.td
+++ b/offload/liboffload/API/Memory.td
@@ -57,7 +57,7 @@ def : Function {
         Param<"ol_queue_handle_t", "Queue", "handle of the queue.", PARAM_IN_OPTIONAL>,
         Param<"void*", "DstPtr", "pointer to copy to", PARAM_IN>,
         Param<"ol_device_handle_t", "DstDevice", "device that DstPtr belongs to", PARAM_IN>,
-        Param<"void*", "SrcPtr", "pointer to copy from", PARAM_IN>,
+        Param<"const void*", "SrcPtr", "pointer to copy from", PARAM_IN>,
         Param<"ol_device_handle_t", "SrcDevice", "device that SrcPtr belongs to", PARAM_IN>,
         Param<"size_t", "Size", "size in bytes of data to copy", PARAM_IN>,
         Param<"ol_event_handle_t*", "EventOut", "optional recorded event for the enqueued operation", PARAM_OUT_OPTIONAL>
diff --git a/offload/liboffload/src/OffloadImpl.cpp b/offload/liboffload/src/OffloadImpl.cpp
index 7b67cbba43e68..d2b331905ab77 100644
--- a/offload/liboffload/src/OffloadImpl.cpp
+++ b/offload/liboffload/src/OffloadImpl.cpp
@@ -399,7 +399,7 @@ ol_event_handle_t makeEvent(ol_queue_handle_t Queue) {
 }
 
 Error olMemcpy_impl(ol_queue_handle_t Queue, void *DstPtr,
-                    ol_device_handle_t DstDevice, void *SrcPtr,
+                    ol_device_handle_t DstDevice, const void *SrcPtr,
                     ol_device_handle_t SrcDevice, size_t Size,
                     ol_event_handle_t *EventOut) {
   if (DstDevice == HostDevice() && SrcDevice == HostDevice()) {

@jhuber6 jhuber6 merged commit 835497a into llvm:main Jun 6, 2025
8 of 9 checks passed
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants