mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
refactor: use qword memcpy for Events with qword packet size
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5c60b4d973
commit
c3ca3ff119
@@ -293,6 +293,16 @@ ze_result_t EventImp<TagSizeT>::hostEventSetValue(TagSizeT eventVal) {
|
||||
|
||||
auto packetHostAddr = getCompletionFieldHostAddress();
|
||||
|
||||
UNRECOVERABLE_IF(sizeof(TagSizeT) > sizeof(uint64_t));
|
||||
|
||||
size_t copySize = sizeof(TagSizeT);
|
||||
const uint64_t copyData = eventVal;
|
||||
|
||||
if (this->singlePacketSize == sizeof(uint64_t)) {
|
||||
// Non-TS Events with dynamic layout size using qword chunks
|
||||
copySize = sizeof(uint64_t);
|
||||
}
|
||||
|
||||
uint32_t packets = 0;
|
||||
for (uint32_t i = 0; i < kernelCount; i++) {
|
||||
uint32_t packetsToSet = kernelEventCompletionData[i].getPacketsUsed();
|
||||
@@ -300,7 +310,7 @@ ze_result_t EventImp<TagSizeT>::hostEventSetValue(TagSizeT eventVal) {
|
||||
if (castToUint64(packetHostAddr) >= castToUint64(ptrOffset(this->hostAddress, totalEventSize))) {
|
||||
break;
|
||||
}
|
||||
memcpy_s(packetHostAddr, sizeof(TagSizeT), static_cast<void *>(&eventVal), sizeof(TagSizeT));
|
||||
memcpy_s(packetHostAddr, copySize, ©Data, copySize);
|
||||
packetHostAddr = ptrOffset(packetHostAddr, this->singlePacketSize);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user