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
13 changes: 13 additions & 0 deletions offload/liboffload/API/Device.td
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,16 @@ def olGetDeviceInfoSize : Function {
Return<"OL_ERRC_INVALID_DEVICE">
];
}

def olInitializeRecordReplay : Function {
let desc = "Initializes the record and replay mechanism.";
let params = [
Param<"ol_device_handle_t", "Device", "handle of the device", PARAM_IN>,
Param<"uint64_t", "MemorySize", " The number of bytes to be (pre-)allocated by the bump allocator", PARAM_IN>,
Param<"void *", "VAddr", "handle of the destination device", PARAM_IN>,
Param<"bool", "IsRecord", "Activates the record replay mechanism in 'record' mode or 'replay' mode", PARAM_IN>,
Param<"bool", "SaveOutput", "Store the device memory after kernel execution on persistent storage", PARAM_IN>,
Param<"uint64_t *", "ReqPtrArgOffset", "handle of the destination device", PARAM_OUT>,
];
let returns = [];
}
15 changes: 15 additions & 0 deletions offload/liboffload/src/OffloadImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1214,5 +1214,20 @@ Error olLaunchHostFunction_impl(ol_queue_handle_t Queue,
Queue->AsyncInfo);
}

Error olInitializeRecordReplay_impl(ol_device_handle_t Device,
uint64_t MemorySize, void *VAddr,
bool IsRecord, bool SaveOutput,
uint64_t *ReqPtrArgOffset) {
uint64_t ReqPtrArgOffsetOut = 0;
Expected<int> Rc = Device->Device->Plugin.initialize_record_replay(
Device->DeviceNum, MemorySize, VAddr, IsRecord, SaveOutput,
ReqPtrArgOffsetOut);
if (Rc) {
return Rc.takeError();
}
*ReqPtrArgOffset = ReqPtrArgOffsetOut;
return Error::success();
}

} // namespace offload
} // namespace llvm