mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Return timestamps for each subdevice via queryTimestampExp
Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7c1ea18f74
commit
6061b61aea
@@ -261,23 +261,33 @@ ze_result_t EventImp<TagSizeT>::queryTimestampsExp(Device *device, uint32_t *pCo
|
||||
isStaticPartitioning = false;
|
||||
}
|
||||
|
||||
if (deviceImp->isSubdevice || !isStaticPartitioning) {
|
||||
if (!isStaticPartitioning) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
uint32_t numPacketsUsed = 1u;
|
||||
if (!deviceImp->isSubdevice) {
|
||||
numPacketsUsed = this->getPacketsInUse();
|
||||
}
|
||||
|
||||
if ((*pCount == 0) ||
|
||||
(*pCount > kernelTimestampsData[timestampPacket].getPacketsUsed())) {
|
||||
*pCount = this->getPacketsInUse();
|
||||
(*pCount > numPacketsUsed)) {
|
||||
*pCount = numPacketsUsed;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
for (auto packetId = 0u; packetId < *pCount; packetId++) {
|
||||
ze_kernel_timestamp_result_t &result = *(pTimestamps + packetId);
|
||||
for (auto i = 0u; i < *pCount; i++) {
|
||||
ze_kernel_timestamp_result_t &result = *(pTimestamps + i);
|
||||
|
||||
auto queryTsEventAssignFunc = [&](uint64_t ×tampFieldForWriting, uint64_t ×tampFieldToCopy) {
|
||||
memcpy_s(×tampFieldForWriting, sizeof(uint64_t), static_cast<void *>(×tampFieldToCopy), sizeof(uint64_t));
|
||||
};
|
||||
|
||||
auto packetId = i;
|
||||
if (deviceImp->isSubdevice) {
|
||||
packetId = static_cast<NEO::SubDevice *>(deviceImp->neoDevice)->getSubDeviceIndex();
|
||||
}
|
||||
|
||||
globalStartTs = kernelTimestampsData[timestampPacket].getGlobalStartValue(packetId);
|
||||
contextStartTs = kernelTimestampsData[timestampPacket].getContextStartValue(packetId);
|
||||
contextEndTs = kernelTimestampsData[timestampPacket].getContextEndValue(packetId);
|
||||
|
||||
Reference in New Issue
Block a user