mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Download timestamp allocation before checking completion
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
a0e7dce57a
commit
1aeb097a63
@ -685,6 +685,7 @@ bool Event::areTimestampsCompleted() {
|
|||||||
if (this->cmdQueue->isWaitForTimestampsEnabled()) {
|
if (this->cmdQueue->isWaitForTimestampsEnabled()) {
|
||||||
for (const auto ×tamp : this->timestampPacketContainer->peekNodes()) {
|
for (const auto ×tamp : this->timestampPacketContainer->peekNodes()) {
|
||||||
for (uint32_t i = 0; i < timestamp->getPacketsUsed(); i++) {
|
for (uint32_t i = 0; i < timestamp->getPacketsUsed(); i++) {
|
||||||
|
this->cmdQueue->getGpgpuCommandStreamReceiver().downloadAllocation(*timestamp->getBaseGraphicsAllocation()->getGraphicsAllocation(this->cmdQueue->getGpgpuCommandStreamReceiver().getRootDeviceIndex()));
|
||||||
if (timestamp->getContextEndValue(i) == 1) {
|
if (timestamp->getContextEndValue(i) == 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -802,8 +802,11 @@ HWTEST_F(TimestampPacketTests, givenTimestampWaitEnabledWhenEnqueueWithEventThen
|
|||||||
EXPECT_EQ(1u, deferredTimestampPackets->peekNodes().size());
|
EXPECT_EQ(1u, deferredTimestampPackets->peekNodes().size());
|
||||||
EXPECT_EQ(1u, timestampPacketContainer->peekNodes().size());
|
EXPECT_EQ(1u, timestampPacketContainer->peekNodes().size());
|
||||||
|
|
||||||
|
EXPECT_FALSE(csr.downloadAllocationCalled);
|
||||||
EXPECT_FALSE(event1.isCompleted());
|
EXPECT_FALSE(event1.isCompleted());
|
||||||
EXPECT_FALSE(event2.isCompleted());
|
EXPECT_FALSE(event2.isCompleted());
|
||||||
|
EXPECT_TRUE(csr.downloadAllocationCalled);
|
||||||
|
csr.downloadAllocationCalled = false;
|
||||||
|
|
||||||
typename FamilyType::TimestampPacketType timestampData[] = {2, 2, 2, 2};
|
typename FamilyType::TimestampPacketType timestampData[] = {2, 2, 2, 2};
|
||||||
for (uint32_t i = 0; i < deferredTimestampPackets->peekNodes()[0]->getPacketsUsed(); i++) {
|
for (uint32_t i = 0; i < deferredTimestampPackets->peekNodes()[0]->getPacketsUsed(); i++) {
|
||||||
@ -812,6 +815,8 @@ HWTEST_F(TimestampPacketTests, givenTimestampWaitEnabledWhenEnqueueWithEventThen
|
|||||||
|
|
||||||
EXPECT_TRUE(event1.isCompleted());
|
EXPECT_TRUE(event1.isCompleted());
|
||||||
EXPECT_FALSE(event2.isCompleted());
|
EXPECT_FALSE(event2.isCompleted());
|
||||||
|
EXPECT_TRUE(csr.downloadAllocationCalled);
|
||||||
|
csr.downloadAllocationCalled = false;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < deferredTimestampPackets->peekNodes()[0]->getPacketsUsed(); i++) {
|
for (uint32_t i = 0; i < deferredTimestampPackets->peekNodes()[0]->getPacketsUsed(); i++) {
|
||||||
timestampPacketContainer->peekNodes()[0]->assignDataToAllTimestamps(i, timestampData);
|
timestampPacketContainer->peekNodes()[0]->assignDataToAllTimestamps(i, timestampData);
|
||||||
@ -819,12 +824,15 @@ HWTEST_F(TimestampPacketTests, givenTimestampWaitEnabledWhenEnqueueWithEventThen
|
|||||||
|
|
||||||
EXPECT_TRUE(event1.isCompleted());
|
EXPECT_TRUE(event1.isCompleted());
|
||||||
EXPECT_TRUE(event2.isCompleted());
|
EXPECT_TRUE(event2.isCompleted());
|
||||||
|
EXPECT_TRUE(csr.downloadAllocationCalled);
|
||||||
|
csr.downloadAllocationCalled = false;
|
||||||
|
|
||||||
cmdQ->finish();
|
cmdQ->finish();
|
||||||
|
|
||||||
EXPECT_TRUE(event1.isCompleted());
|
EXPECT_TRUE(event1.isCompleted());
|
||||||
EXPECT_TRUE(event2.isCompleted());
|
EXPECT_TRUE(event2.isCompleted());
|
||||||
EXPECT_EQ(csr.waitForCompletionWithTimeoutTaskCountCalled, 0u);
|
EXPECT_EQ(csr.waitForCompletionWithTimeoutTaskCountCalled, 0u);
|
||||||
|
EXPECT_TRUE(csr.downloadAllocationCalled);
|
||||||
|
|
||||||
clReleaseEvent(clEvent1);
|
clReleaseEvent(clEvent1);
|
||||||
clReleaseEvent(clEvent2);
|
clReleaseEvent(clEvent2);
|
||||||
|
Reference in New Issue
Block a user