fix: return correct device address for standalone CB Event

Related-To: NEO-8145

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2024-02-16 18:42:09 +00:00
committed by Compute-Runtime-Automation
parent cb914a7b49
commit 5d6ce43cf9
2 changed files with 10 additions and 12 deletions

View File

@@ -19,19 +19,12 @@ ZE_APIEXPORT ze_result_t ZE_APICALL
zexEventGetDeviceAddress(ze_event_handle_t event, uint64_t *completionValue, uint64_t *address) {
auto eventObj = Event::fromHandle(event);
if (!eventObj || !eventObj->isCounterBased() || !completionValue || !address) {
if (!eventObj || !eventObj->isCounterBased() || !eventObj->getInOrderExecInfo() || !completionValue || !address) {
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
}
*completionValue = eventObj->getInOrderExecSignalValueWithSubmissionCounter();
auto deviceAlloc = eventObj->getInOrderExecDataAllocation();
if (deviceAlloc) {
*address = deviceAlloc->getGpuAddress() + eventObj->getInOrderAllocationOffset();
} else {
*address = 0;
}
*address = eventObj->getInOrderExecInfo()->getBaseDeviceAddress() + eventObj->getInOrderAllocationOffset();
return ZE_RESULT_SUCCESS;
}