Skip to content

Commit 0e0a280

Browse files
Create structure UsageInfo for task count and residency task count
Change-Id: I0899c88d9e567a09ba46461ae69cf6c80f713e67 Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent e599d15 commit 0e0a280

23 files changed

+115
-154
lines changed

runtime/command_stream/aub_command_stream_receiver_hw.inl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ FlushStamp AUBCommandStreamReceiverHw<GfxFamily>::flush(BatchBuffer &batchBuffer
383383
}
384384
} else {
385385
allocationsForResidency.push_back(batchBuffer.commandBufferAllocation);
386-
batchBuffer.commandBufferAllocation->residencyTaskCount[this->deviceIndex] = this->taskCount;
386+
batchBuffer.commandBufferAllocation->updateResidencyTaskCount(this->taskCount, this->deviceIndex);
387387
}
388388
}
389389
processResidency(allocationsForResidency, osContext);
@@ -709,17 +709,17 @@ void AUBCommandStreamReceiverHw<GfxFamily>::processResidency(ResidencyContainer
709709
if (!writeMemory(*gfxAllocation)) {
710710
DEBUG_BREAK_IF(!((gfxAllocation->getUnderlyingBufferSize() == 0) || !gfxAllocation->isAubWritable()));
711711
}
712-
gfxAllocation->residencyTaskCount[this->deviceIndex] = this->taskCount + 1;
712+
gfxAllocation->updateResidencyTaskCount(this->taskCount + 1, this->deviceIndex);
713713
}
714714

715715
dumpAubNonWritable = false;
716716
}
717717

718718
template <typename GfxFamily>
719719
void AUBCommandStreamReceiverHw<GfxFamily>::makeNonResident(GraphicsAllocation &gfxAllocation) {
720-
if (gfxAllocation.residencyTaskCount[this->deviceIndex] != ObjectNotResident) {
720+
if (gfxAllocation.isResident(this->deviceIndex)) {
721721
this->getEvictionAllocations().push_back(&gfxAllocation);
722-
gfxAllocation.residencyTaskCount[this->deviceIndex] = ObjectNotResident;
722+
gfxAllocation.resetResidencyTaskCount(this->deviceIndex);
723723
}
724724
}
725725

runtime/command_stream/command_stream_receiver.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ CommandStreamReceiver::~CommandStreamReceiver() {
5858
}
5959

6060
void CommandStreamReceiver::makeResident(GraphicsAllocation &gfxAllocation) {
61-
auto submissionTaskCount = this->taskCount + 1;
62-
if (gfxAllocation.residencyTaskCount[deviceIndex] < (int)submissionTaskCount) {
61+
int submissionTaskCount = this->taskCount + 1;
62+
if (gfxAllocation.getResidencyTaskCount(deviceIndex) < submissionTaskCount) {
6363
this->getResidencyAllocations().push_back(&gfxAllocation);
6464
gfxAllocation.updateTaskCount(submissionTaskCount, deviceIndex);
65-
if (gfxAllocation.residencyTaskCount[deviceIndex] == ObjectNotResident) {
65+
if (!gfxAllocation.isResident(deviceIndex)) {
6666
this->totalMemoryUsed += gfxAllocation.getUnderlyingBufferSize();
6767
}
6868
}
69-
gfxAllocation.residencyTaskCount[deviceIndex] = submissionTaskCount;
69+
gfxAllocation.updateResidencyTaskCount(submissionTaskCount, deviceIndex);
7070
}
7171

7272
void CommandStreamReceiver::processEviction(OsContext &osContext) {
7373
this->getEvictionAllocations().clear();
7474
}
7575

7676
void CommandStreamReceiver::makeNonResident(GraphicsAllocation &gfxAllocation) {
77-
if (gfxAllocation.residencyTaskCount[deviceIndex] != ObjectNotResident) {
77+
if (gfxAllocation.isResident(deviceIndex)) {
7878
makeCoherent(gfxAllocation);
7979
if (gfxAllocation.peekEvictable()) {
8080
this->getEvictionAllocations().push_back(&gfxAllocation);
@@ -83,7 +83,7 @@ void CommandStreamReceiver::makeNonResident(GraphicsAllocation &gfxAllocation) {
8383
}
8484
}
8585

86-
gfxAllocation.residencyTaskCount[deviceIndex] = ObjectNotResident;
86+
gfxAllocation.resetResidencyTaskCount(this->deviceIndex);
8787
}
8888

8989
void CommandStreamReceiver::makeSurfacePackNonResident(ResidencyContainer &allocationsForResidency, OsContext &osContext) {

runtime/command_stream/command_stream_receiver_with_aub_dump.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ FlushStamp CommandStreamReceiverWithAUBDump<BaseCSR>::flush(BatchBuffer &batchBu
3434

3535
template <typename BaseCSR>
3636
void CommandStreamReceiverWithAUBDump<BaseCSR>::makeNonResident(GraphicsAllocation &gfxAllocation) {
37-
int residencyTaskCount = gfxAllocation.residencyTaskCount[this->deviceIndex];
37+
int residencyTaskCount = gfxAllocation.getResidencyTaskCount(this->deviceIndex);
3838
BaseCSR::makeNonResident(gfxAllocation);
39-
gfxAllocation.residencyTaskCount[this->deviceIndex] = residencyTaskCount;
39+
gfxAllocation.updateResidencyTaskCount(residencyTaskCount, this->deviceIndex);
4040
if (aubCSR) {
4141
aubCSR->makeNonResident(gfxAllocation);
4242
}

runtime/command_stream/tbx_command_stream_receiver_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ void TbxCommandStreamReceiverHw<GfxFamily>::processResidency(ResidencyContainer
369369
if (!writeMemory(*gfxAllocation)) {
370370
DEBUG_BREAK_IF(!(gfxAllocation->getUnderlyingBufferSize() == 0));
371371
}
372-
gfxAllocation->residencyTaskCount[this->deviceIndex] = this->taskCount + 1;
372+
gfxAllocation->updateResidencyTaskCount(this->taskCount + 1, this->deviceIndex);
373373
}
374374
}
375375

runtime/memory_manager/graphics_allocation.cpp

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,40 +19,23 @@ bool GraphicsAllocation::isL3Capable() {
1919
GraphicsAllocation::GraphicsAllocation(void *cpuPtrIn, uint64_t gpuAddress, uint64_t baseAddress, size_t sizeIn) : gpuBaseAddress(baseAddress),
2020
size(sizeIn),
2121
cpuPtr(cpuPtrIn),
22-
gpuAddress(gpuAddress),
23-
taskCounts(maxOsContextCount) {
24-
initTaskCounts();
22+
gpuAddress(gpuAddress) {
2523
}
2624

2725
GraphicsAllocation::GraphicsAllocation(void *cpuPtrIn, size_t sizeIn, osHandle sharedHandleIn) : size(sizeIn),
2826
cpuPtr(cpuPtrIn),
2927
gpuAddress(castToUint64(cpuPtrIn)),
30-
sharedHandle(sharedHandleIn),
31-
taskCounts(maxOsContextCount) {
32-
initTaskCounts();
28+
sharedHandle(sharedHandleIn) {
3329
}
3430
GraphicsAllocation::~GraphicsAllocation() = default;
3531

36-
bool GraphicsAllocation::peekWasUsed() const { return registeredContextsNum > 0; }
37-
3832
void GraphicsAllocation::updateTaskCount(uint32_t newTaskCount, uint32_t contextId) {
39-
UNRECOVERABLE_IF(contextId >= taskCounts.size());
40-
if (taskCounts[contextId] == ObjectNotUsed) {
33+
if (usageInfos[contextId].taskCount == ObjectNotUsed) {
4134
registeredContextsNum++;
4235
}
4336
if (newTaskCount == ObjectNotUsed) {
4437
registeredContextsNum--;
4538
}
46-
taskCounts[contextId] = newTaskCount;
47-
}
48-
49-
uint32_t GraphicsAllocation::getTaskCount(uint32_t contextId) const {
50-
UNRECOVERABLE_IF(contextId >= taskCounts.size());
51-
return taskCounts[contextId];
52-
}
53-
void GraphicsAllocation::initTaskCounts() {
54-
for (auto i = 0u; i < taskCounts.size(); i++) {
55-
taskCounts[i] = ObjectNotUsed;
56-
}
39+
usageInfos[contextId].taskCount = newTaskCount;
5740
}
5841
} // namespace OCLRT

runtime/memory_manager/graphics_allocation.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ const uint32_t ObjectNotUsed = (uint32_t)-1;
3434

3535
class Gmm;
3636

37+
struct UsageInfo {
38+
uint32_t taskCount = ObjectNotUsed;
39+
int residencyTaskCount = ObjectNotResident;
40+
};
41+
3742
class GraphicsAllocation : public IDNode<GraphicsAllocation> {
3843
public:
3944
OsHandleStorage fragmentsStorage;
4045
bool is32BitAllocation = false;
4146
uint64_t gpuBaseAddress = 0;
4247
Gmm *gmm = nullptr;
4348
uint64_t allocationOffset = 0u;
44-
int residencyTaskCount[maxOsContextCount] = {ObjectNotResident, ObjectNotResident, ObjectNotResident, ObjectNotResident};
4549
void *driverAllocatedCpuPointer = nullptr;
4650
DevicesBitfield devicesBitfield = 0;
4751
bool flushL3Required = false;
@@ -113,7 +117,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
113117
void setEvictable(bool evictable) { this->evictable = evictable; }
114118
bool peekEvictable() const { return evictable; }
115119

116-
bool isResident(uint32_t contextId) const { return residencyTaskCount[contextId] != ObjectNotResident; }
120+
bool isResident(uint32_t contextId) const { return ObjectNotResident != getResidencyTaskCount(contextId); }
117121
void setLocked(bool locked) { this->locked = locked; }
118122
bool isLocked() const { return locked; }
119123

@@ -123,13 +127,15 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
123127
MemoryPool::Type getMemoryPool() {
124128
return memoryPool;
125129
}
126-
bool peekWasUsed() const;
130+
bool peekWasUsed() const { return registeredContextsNum > 0; }
127131
void updateTaskCount(uint32_t newTaskCount, uint32_t contextId);
128-
uint32_t getTaskCount(uint32_t contextId) const;
132+
uint32_t getTaskCount(uint32_t contextId) const { return usageInfos[contextId].taskCount; }
129133

130-
protected:
131-
void initTaskCounts();
134+
void updateResidencyTaskCount(int newTaskCount, uint32_t contextId) { usageInfos[contextId].residencyTaskCount = newTaskCount; }
135+
int getResidencyTaskCount(uint32_t contextId) const { return usageInfos[contextId].residencyTaskCount; }
136+
void resetResidencyTaskCount(uint32_t contextId) { updateResidencyTaskCount(ObjectNotResident, contextId); }
132137

138+
protected:
133139
//this variable can only be modified from SubmissionAggregator
134140
friend class SubmissionAggregator;
135141
size_t size = 0;
@@ -146,7 +152,7 @@ class GraphicsAllocation : public IDNode<GraphicsAllocation> {
146152
bool aubWritable = true;
147153
bool allocDumpable = false;
148154
bool memObjectsAllocationWithWritableFlags = false;
149-
StackVec<uint32_t, maxOsContextCount> taskCounts;
155+
StackVec<UsageInfo, maxOsContextCount> usageInfos{maxOsContextCount};
150156
std::atomic<uint32_t> registeredContextsNum{0};
151157
};
152158
} // namespace OCLRT

runtime/os_interface/linux/drm_command_stream.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void DrmCommandStreamReceiver<GfxFamily>::makeNonResident(GraphicsAllocation &gf
129129
// Vector is moved to command buffer inside flush.
130130
// If flush wasn't called we need to make all objects non-resident.
131131
// If makeNonResident is called before flush, vector will be cleared.
132-
if (gfxAllocation.residencyTaskCount[this->deviceIndex] != ObjectNotResident) {
132+
if (gfxAllocation.isResident(this->deviceIndex)) {
133133
if (this->residency.size() != 0) {
134134
this->residency.clear();
135135
}
@@ -139,7 +139,7 @@ void DrmCommandStreamReceiver<GfxFamily>::makeNonResident(GraphicsAllocation &gf
139139
}
140140
}
141141
}
142-
gfxAllocation.residencyTaskCount[this->deviceIndex] = ObjectNotResident;
142+
gfxAllocation.resetResidencyTaskCount(this->deviceIndex);
143143
}
144144

145145
template <typename GfxFamily>

runtime/os_interface/windows/wddm_device_command_stream.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ FlushStamp WddmCommandStreamReceiver<GfxFamily>::flush(BatchBuffer &batchBuffer,
7979
makeResident(*batchBuffer.commandBufferAllocation);
8080
} else {
8181
allocationsForResidency.push_back(batchBuffer.commandBufferAllocation);
82-
batchBuffer.commandBufferAllocation->residencyTaskCount[this->deviceIndex] = this->taskCount;
82+
batchBuffer.commandBufferAllocation->updateResidencyTaskCount(this->taskCount, this->deviceIndex);
8383
}
8484

8585
this->processResidency(allocationsForResidency, osContext);

unit_tests/command_stream/aub_command_stream_receiver_1_tests.cpp

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -201,26 +201,26 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWhenMakeResidentC
201201

202202
// First makeResident marks the allocation resident
203203
aubCsr->makeResident(*gfxAllocation);
204-
EXPECT_NE(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
204+
EXPECT_NE(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
205205
EXPECT_EQ(aubCsr->peekTaskCount() + 1, gfxAllocation->getTaskCount(0));
206-
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->residencyTaskCount[0u]);
206+
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->getResidencyTaskCount(0u));
207207
EXPECT_EQ(1u, aubCsr->getResidencyAllocations().size());
208208

209209
// Second makeResident should have no impact
210210
aubCsr->makeResident(*gfxAllocation);
211-
EXPECT_NE(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
211+
EXPECT_NE(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
212212
EXPECT_EQ(aubCsr->peekTaskCount() + 1, gfxAllocation->getTaskCount(0));
213-
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->residencyTaskCount[0u]);
213+
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->getResidencyTaskCount(0u));
214214
EXPECT_EQ(1u, aubCsr->getResidencyAllocations().size());
215215

216216
// First makeNonResident marks the allocation as nonresident
217217
aubCsr->makeNonResident(*gfxAllocation);
218-
EXPECT_EQ(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
218+
EXPECT_EQ(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
219219
EXPECT_EQ(1u, aubCsr->getEvictionAllocations().size());
220220

221221
// Second makeNonResident should have no impact
222222
aubCsr->makeNonResident(*gfxAllocation);
223-
EXPECT_EQ(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
223+
EXPECT_EQ(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
224224
EXPECT_EQ(1u, aubCsr->getEvictionAllocations().size());
225225

226226
memoryManager->freeGraphicsMemoryImpl(gfxAllocation);
@@ -430,17 +430,17 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon
430430
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
431431
auto engineType = OCLRT::ENGINE_RCS;
432432

433-
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
433+
EXPECT_EQ(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
434434

435435
aubCsr->overrideDispatchPolicy(DispatchMode::ImmediateDispatch);
436436
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
437437

438-
EXPECT_NE(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
439-
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, commandBuffer->residencyTaskCount[0u]);
438+
EXPECT_NE(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
439+
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, commandBuffer->getResidencyTaskCount(0u));
440440

441441
aubCsr->makeSurfacePackNonResident(aubCsr->getResidencyAllocations(), *pDevice->getOsContext());
442442

443-
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
443+
EXPECT_EQ(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
444444
}
445445

446446
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNonStandaloneModeWhenFlushIsCalledThenItShouldNotCallMakeResidentOnCommandBufferAllocation) {
@@ -452,11 +452,11 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNonStanda
452452
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, cs.getUsed(), &cs};
453453
auto engineType = OCLRT::ENGINE_RCS;
454454

455-
EXPECT_EQ(ObjectNotResident, aubExecutionEnvironment->commandBuffer->residencyTaskCount[0u]);
455+
EXPECT_EQ(ObjectNotResident, aubExecutionEnvironment->commandBuffer->getResidencyTaskCount(0u));
456456

457457
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
458458

459-
EXPECT_EQ(ObjectNotResident, aubExecutionEnvironment->commandBuffer->residencyTaskCount[0u]);
459+
EXPECT_EQ(ObjectNotResident, aubExecutionEnvironment->commandBuffer->getResidencyTaskCount(0u));
460460
}
461461

462462
HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandaloneModeWhenFlushIsCalledThenItShouldCallMakeResidentOnResidencyAllocations) {
@@ -473,22 +473,22 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon
473473
auto engineType = OCLRT::ENGINE_RCS;
474474
ResidencyContainer allocationsForResidency = {gfxAllocation};
475475

476-
EXPECT_EQ(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
477-
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
476+
EXPECT_EQ(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
477+
EXPECT_EQ(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
478478

479479
aubCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
480480
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
481481

482-
EXPECT_NE(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
483-
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->residencyTaskCount[0u]);
482+
EXPECT_NE(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
483+
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->getResidencyTaskCount(0u));
484484

485-
EXPECT_NE(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
486-
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, commandBuffer->residencyTaskCount[0u]);
485+
EXPECT_NE(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
486+
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, commandBuffer->getResidencyTaskCount(0u));
487487

488488
aubCsr->makeSurfacePackNonResident(allocationsForResidency, *pDevice->getOsContext());
489489

490-
EXPECT_EQ(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
491-
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
490+
EXPECT_EQ(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
491+
EXPECT_EQ(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
492492

493493
memoryManager->freeGraphicsMemory(gfxAllocation);
494494
}
@@ -506,15 +506,15 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNonStanda
506506
auto engineType = OCLRT::ENGINE_RCS;
507507
ResidencyContainer allocationsForResidency = {gfxAllocation};
508508

509-
EXPECT_EQ(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
510-
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
509+
EXPECT_EQ(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
510+
EXPECT_EQ(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
511511

512512
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
513513

514-
EXPECT_NE(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
515-
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->residencyTaskCount[0u]);
514+
EXPECT_NE(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
515+
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->getResidencyTaskCount(0u));
516516

517-
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
517+
EXPECT_EQ(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
518518

519519
memoryManager->freeGraphicsMemoryImpl(gfxAllocation);
520520
}
@@ -544,22 +544,22 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon
544544
auto engineType = OCLRT::ENGINE_RCS;
545545
ResidencyContainer allocationsForResidency = {gfxAllocation};
546546

547-
EXPECT_EQ(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
548-
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
547+
EXPECT_EQ(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
548+
EXPECT_EQ(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
549549

550550
aubCsr->overrideDispatchPolicy(DispatchMode::BatchedDispatch);
551551
aubCsr->flush(batchBuffer, engineType, allocationsForResidency, *pDevice->getOsContext());
552552

553-
EXPECT_NE(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
554-
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->residencyTaskCount[0u]);
553+
EXPECT_NE(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
554+
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, gfxAllocation->getResidencyTaskCount(0u));
555555

556-
EXPECT_NE(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
557-
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, commandBuffer->residencyTaskCount[0u]);
556+
EXPECT_NE(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
557+
EXPECT_EQ((int)aubCsr->peekTaskCount() + 1, commandBuffer->getResidencyTaskCount(0u));
558558

559559
aubCsr->makeSurfacePackNonResident(allocationsForResidency, *pDevice->getOsContext());
560560

561-
EXPECT_EQ(ObjectNotResident, gfxAllocation->residencyTaskCount[0u]);
562-
EXPECT_EQ(ObjectNotResident, commandBuffer->residencyTaskCount[0u]);
561+
EXPECT_EQ(ObjectNotResident, gfxAllocation->getResidencyTaskCount(0u));
562+
EXPECT_EQ(ObjectNotResident, commandBuffer->getResidencyTaskCount(0u));
563563

564564
memoryManager->freeGraphicsMemory(gfxAllocation);
565565
}

0 commit comments

Comments
 (0)