Optimize event creation time.

Prevent accessing local memory from the host.
Create an array on stack with desired value and pass it to filling function.
175x faster call execution for scenario with profiling and device events.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2022-01-26 09:58:36 +00:00
committed by Compute-Runtime-Automation
parent 63f406a58c
commit 08d361260e

View File

@@ -164,7 +164,15 @@ ze_result_t EventImp<TagSizeT>::hostEventSetValueTimestamps(TagSizeT eventVal) {
baseAddr += singlePacketSize;
}
}
assignKernelEventCompletionData(hostAddress);
const auto dataSize = 4u * EventPacketsCount::maxKernelSplit * NEO::TimestampPacketSizeControl::preferredPacketCount;
TagSizeT tagValues[dataSize];
for (uint32_t index = 0u; index < dataSize; index++) {
tagValues[index] = eventVal;
}
assignKernelEventCompletionData(tagValues);
return ZE_RESULT_SUCCESS;
}