Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions offload/liboffload/API/Memory.td
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,26 @@ def olMemFill : Function {
Return<"OL_ERRC_INVALID_SIZE", ["`FillSize % PatternSize != 0`"]>
];
}

def olMemDataMappedNotify : Function {
let desc = "Notifies device about mapping of memory block.";
let params = [
Param<"ol_device_handle_t", "Device", "handle of the device to allocate on", PARAM_IN>,
Param<"void *", "Ptr", "Host Pointer", PARAM_IN>,
Param<"size_t", "Size", "size of the allocation in bytes", PARAM_IN>
];
let returns = [
Return<"OL_ERRC_INVALID_SIZE", [
"`Size == 0`"
]>
];
}

def olMemDataUnMappedNotify : Function {
let desc = "Notifies device about unmapping of memory block.";
let params = [
Param<"ol_device_handle_t", "Device", "handle of the device to allocate on", PARAM_IN>,
Param<"void *", "Ptr", "Host Pointer", PARAM_IN>
];
let returns = [];
}
10 changes: 10 additions & 0 deletions offload/liboffload/src/OffloadImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1214,5 +1214,15 @@ Error olLaunchHostFunction_impl(ol_queue_handle_t Queue,
Queue->AsyncInfo);
}

Error olMemDataMappedNotify_impl(ol_device_handle_t Device, void *Ptr,
size_t Size) {
return Device->Device->notifyDataMapped(Ptr, Size);
}

Error olMemDataUnMappedNotify_impl(ol_device_handle_t Device, void *Ptr) {
return Device->Device->notifyDataUnmapped(Ptr);
}


} // namespace offload
} // namespace llvm