Skip to content

Commit 0131e66

Browse files
Allow Device creating multiple CSRs [6/n]
- Introduce default Engine query - Improve Deferred Deleter usage - Remove Tag Allocation from Device Change-Id: Iaa88d8dc0166325acf9a157dcd2217ea408ee285 Signed-off-by: Dunajski, Bartosz <[email protected]>
1 parent 3e800d5 commit 0131e66

28 files changed

+112
-101
lines changed

runtime/command_queue/command_queue.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ CommandQueue::CommandQueue(Context *context,
7777
commandQueueProperties = getCmdQueueProperties<cl_command_queue_properties>(properties);
7878
flushStamp.reset(new FlushStampTracker(true));
7979

80-
processProperties();
81-
8280
if (device) {
83-
engine = &device->getEngine(engineId);
81+
engine = &device->getDefaultEngine();
8482
if (getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
8583
timestampPacketContainer = std::make_unique<TimestampPacketContainer>();
8684
}
8785
}
86+
87+
processProperties();
8888
}
8989

9090
CommandQueue::~CommandQueue() {

runtime/command_queue/command_queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
428428

429429
QueuePriority priority;
430430
QueueThrottle throttle;
431-
size_t engineId = 0;
431+
uint32_t engineId = 0;
432432

433433
bool perfCountersEnabled;
434434
cl_uint perfCountersConfig;

runtime/device/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ bool Device::createDeviceImpl(const HardwareInfo *pHwInfo, Device &outDevice) {
129129
pDevice->osTime = OSTime::create(commandStreamReceiver->getOSInterface());
130130
}
131131
pDevice->driverInfo.reset(DriverInfo::create(commandStreamReceiver->getOSInterface()));
132-
pDevice->tagAddress = reinterpret_cast<uint32_t *>(commandStreamReceiver->getTagAllocation()->getUnderlyingBuffer());
133132

134133
pDevice->initializeCaps();
135134

@@ -150,6 +149,7 @@ bool Device::createDeviceImpl(const HardwareInfo *pHwInfo, Device &outDevice) {
150149
}
151150

152151
outDevice.executionEnvironment->memoryManager->setForce32BitAllocations(pDevice->getDeviceInfo().force32BitAddressess);
152+
outDevice.executionEnvironment->memoryManager->setDefaultEngineIndex(deviceCsrIndex);
153153

154154
if (pDevice->preemptionMode == PreemptionMode::MidThread || pDevice->isSourceLevelDebuggerActive()) {
155155
size_t requiredSize = pHwInfo->capabilityTable.requiredPreemptionSurfaceSize;

runtime/device/device.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ class Device : public BaseObject<_cl_device_id> {
7070
deviceInfo.force32BitAddressess = value;
7171
}
7272

73-
EngineControl &getEngine(size_t engineId);
73+
EngineControl &getEngine(uint32_t engineId);
74+
EngineControl &getDefaultEngine();
7475

7576
volatile uint32_t *getTagAddress() const;
7677

@@ -146,7 +147,6 @@ class Device : public BaseObject<_cl_device_id> {
146147
HardwareCapabilities hardwareCapabilities = {};
147148
DeviceInfo deviceInfo;
148149

149-
volatile uint32_t *tagAddress = nullptr;
150150
GraphicsAllocation *preemptionAllocation = nullptr;
151151
std::unique_ptr<OSTime> osTime;
152152
std::unique_ptr<DriverInfo> driverInfo;
@@ -161,6 +161,7 @@ class Device : public BaseObject<_cl_device_id> {
161161
PreemptionMode preemptionMode;
162162
ExecutionEnvironment *executionEnvironment = nullptr;
163163
uint32_t deviceIndex = 0u;
164+
uint32_t defaultEngineIndex = 0;
164165
};
165166

166167
template <cl_device_info Param>
@@ -171,12 +172,12 @@ inline void Device::getCap(const void *&src,
171172
retSize = size = DeviceInfoTable::Map<Param>::size;
172173
}
173174

174-
inline EngineControl &Device::getEngine(size_t engineId) {
175+
inline EngineControl &Device::getEngine(uint32_t engineId) {
175176
return engines[engineId];
176177
}
177178

178-
inline volatile uint32_t *Device::getTagAddress() const {
179-
return tagAddress;
179+
inline EngineControl &Device::getDefaultEngine() {
180+
return engines[defaultEngineIndex];
180181
}
181182

182183
inline MemoryManager *Device::getMemoryManager() const {

runtime/device_queue/device_queue_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void DeviceQueueHw<GfxFamily>::addExecutionModelCleanUpSection(Kernel *parentKer
230230

231231
PipeControlHelper<GfxFamily>::obtainPipeControlAndProgramPostSyncOperation(&slbCS, PIPE_CONTROL::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA, criticalSectionAddress, ExecutionModelCriticalSection::Free);
232232

233-
uint64_t tagAddress = (uint64_t)device->getTagAddress();
233+
uint64_t tagAddress = reinterpret_cast<uint64_t>(device->getDefaultEngine().commandStreamReceiver->getTagAddress());
234234

235235
addPipeControlCmdWa();
236236

runtime/execution_environment/execution_environment.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class BuiltIns;
2424
struct HardwareInfo;
2525
class OSInterface;
2626

27-
using CsrContainer = std::array<std::unique_ptr<CommandStreamReceiver>, EngineInstanceT::numGpgpuEngineInstances>;
27+
using CsrContainer = std::vector<std::array<std::unique_ptr<CommandStreamReceiver>, EngineInstanceT::numGpgpuEngineInstances>>;
2828

2929
class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment> {
3030
private:
@@ -51,7 +51,7 @@ class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment>
5151
std::unique_ptr<OSInterface> osInterface;
5252
std::unique_ptr<MemoryManager> memoryManager;
5353
std::unique_ptr<AubCenter> aubCenter;
54-
std::vector<CsrContainer> commandStreamReceivers;
54+
CsrContainer commandStreamReceivers;
5555
std::unique_ptr<BuiltIns> builtins;
5656
std::unique_ptr<CompilerInterface> compilerInterface;
5757
std::unique_ptr<SourceLevelDebugger> sourceLevelDebugger;

runtime/mem_obj/mem_obj.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ void MemObj::releaseAllocatedMapPtr() {
288288
}
289289

290290
void MemObj::waitForCsrCompletion() {
291-
memoryManager->getCommandStreamReceiver(0)->waitForCompletionWithTimeout(false, TimeoutControls::maxTimeout, graphicsAllocation->getTaskCount(0u));
291+
memoryManager->getDefaultCommandStreamReceiver(0)->waitForCompletionWithTimeout(false, TimeoutControls::maxTimeout, graphicsAllocation->getTaskCount(0u));
292292
}
293293

294294
void MemObj::destroyGraphicsAllocation(GraphicsAllocation *allocation, bool asyncDestroy) {

runtime/memory_manager/deferrable_allocation_deletion.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "runtime/command_stream/command_stream_receiver.h"
99
#include "runtime/memory_manager/deferrable_allocation_deletion.h"
1010
#include "runtime/memory_manager/memory_manager.h"
11+
#include "runtime/os_interface/os_context.h"
1112

1213
namespace OCLRT {
1314

@@ -16,11 +17,16 @@ DeferrableAllocationDeletion::DeferrableAllocationDeletion(MemoryManager &memory
1617
void DeferrableAllocationDeletion::apply() {
1718
while (graphicsAllocation.isUsed()) {
1819

19-
for (auto contextId = 0u; contextId < memoryManager.getOsContextCount(); contextId++) {
20-
if (graphicsAllocation.isUsedByContext(contextId)) {
21-
auto currentContextTaskCount = *memoryManager.getCommandStreamReceiver(contextId)->getTagAddress();
22-
if (graphicsAllocation.getTaskCount(contextId) <= currentContextTaskCount) {
23-
graphicsAllocation.resetTaskCount(contextId);
20+
for (auto &deviceCsrs : memoryManager.getCommandStreamReceivers()) {
21+
for (auto &csr : deviceCsrs) {
22+
if (csr) {
23+
auto contextId = csr->getOsContext().getContextId();
24+
if (graphicsAllocation.isUsedByContext(contextId)) {
25+
auto currentContextTaskCount = *csr->getTagAddress();
26+
if (graphicsAllocation.getTaskCount(contextId) <= currentContextTaskCount) {
27+
graphicsAllocation.resetTaskCount(contextId);
28+
}
29+
}
2430
}
2531
}
2632
}

runtime/memory_manager/host_ptr_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ RequirementsStatus HostPtrManager::checkAllocationsForOverlapping(MemoryManager
282282
if (checkedFragments->status[i] == OverlapStatus::FRAGMENT_OVERLAPING_AND_BIGGER_THEN_STORED_FRAGMENT) {
283283
// clean temporary allocations
284284

285-
auto commandStreamReceiver = memoryManager.getCommandStreamReceiver(0);
285+
auto commandStreamReceiver = memoryManager.getDefaultCommandStreamReceiver(0);
286286
auto allocationStorage = commandStreamReceiver->getInternalAllocationStorage();
287287
uint32_t taskCount = *commandStreamReceiver->getTagAddress();
288288
allocationStorage->cleanAllocationList(taskCount, TEMPORARY_ALLOCATION);

runtime/memory_manager/memory_manager.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ void MemoryManager::freeGraphicsMemory(GraphicsAllocation *gfxAllocation) {
137137
//if not in use destroy in place
138138
//if in use pass to temporary allocation list that is cleaned on blocking calls
139139
void MemoryManager::checkGpuUsageAndDestroyGraphicsAllocations(GraphicsAllocation *gfxAllocation) {
140-
if (!gfxAllocation->isUsed() || gfxAllocation->getTaskCount(0u) <= *getCommandStreamReceiver(0)->getTagAddress()) {
140+
if (!gfxAllocation->isUsed() || gfxAllocation->getTaskCount(0u) <= *getCommandStreamReceivers()[0][defaultEngineIndex]->getTagAddress()) {
141141
freeGraphicsMemory(gfxAllocation);
142142
} else {
143-
getCommandStreamReceiver(0)->getInternalAllocationStorage()->storeAllocation(std::unique_ptr<GraphicsAllocation>(gfxAllocation), TEMPORARY_ALLOCATION);
143+
getCommandStreamReceivers()[0][defaultEngineIndex]->getInternalAllocationStorage()->storeAllocation(std::unique_ptr<GraphicsAllocation>(gfxAllocation), TEMPORARY_ALLOCATION);
144144
}
145145
}
146146

@@ -274,9 +274,13 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &
274274
}
275275
return allocateGraphicsMemory(allocationData.size, MemoryConstants::pageSize, allocationData.flags.forcePin, allocationData.flags.uncacheable);
276276
}
277-
CommandStreamReceiver *MemoryManager::getCommandStreamReceiver(uint32_t contextId) {
278-
UNRECOVERABLE_IF(executionEnvironment.commandStreamReceivers.size() < 1);
279-
return executionEnvironment.commandStreamReceivers[contextId][0].get();
277+
278+
const CsrContainer &MemoryManager::getCommandStreamReceivers() const {
279+
return executionEnvironment.commandStreamReceivers;
280+
}
281+
282+
CommandStreamReceiver *MemoryManager::getDefaultCommandStreamReceiver(uint32_t deviceId) const {
283+
return executionEnvironment.commandStreamReceivers[deviceId][defaultEngineIndex].get();
280284
}
281285

282286
} // namespace OCLRT

runtime/memory_manager/memory_manager.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class AllocsTracker;
3030
class MapBaseAllocationTracker;
3131
class SVMAllocsManager;
3232

33+
using CsrContainer = std::vector<std::array<std::unique_ptr<CommandStreamReceiver>, EngineInstanceT::numGpgpuEngineInstances>>;
34+
3335
enum AllocationUsage {
3436
TEMPORARY_ALLOCATION,
3537
REUSABLE_ALLOCATION
@@ -231,8 +233,10 @@ class MemoryManager {
231233

232234
OsContext *createAndRegisterOsContext(EngineInstanceT engineType);
233235
uint32_t getOsContextCount() { return static_cast<uint32_t>(registeredOsContexts.size()); }
234-
CommandStreamReceiver *getCommandStreamReceiver(uint32_t contextId);
236+
CommandStreamReceiver *getDefaultCommandStreamReceiver(uint32_t deviceId) const;
237+
const CsrContainer &getCommandStreamReceivers() const;
235238
HostPtrManager *getHostPtrManager() const { return hostPtrManager.get(); }
239+
void setDefaultEngineIndex(uint32_t index) { defaultEngineIndex = index; }
236240

237241
protected:
238242
static bool getAllocationData(AllocationData &allocationData, const AllocationFlags &flags, const DevicesBitfield devicesBitfield,
@@ -251,6 +255,7 @@ class MemoryManager {
251255
std::vector<OsContext *> registeredOsContexts;
252256
std::unique_ptr<HostPtrManager> hostPtrManager;
253257
uint32_t latestContextId = std::numeric_limits<uint32_t>::max();
258+
uint32_t defaultEngineIndex = 0;
254259
};
255260

256261
std::unique_ptr<DeferredDeleter> createDeferredDeleter();

runtime/memory_manager/residency.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
#pragma once
99
#include <cinttypes>
1010
#include <vector>
11+
#include "engine_node.h"
1112
namespace OCLRT {
1213

13-
constexpr uint32_t maxOsContextCount = 4u;
14+
constexpr uint32_t maxOsContextCount = 4u * static_cast<uint32_t>(gpgpuEngineInstances.size());
1415

1516
struct ResidencyData {
1617
ResidencyData() {

runtime/os_interface/windows/wddm_memory_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ void WddmMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation
288288

289289
UNRECOVERABLE_IF(DebugManager.flags.CreateMultipleDevices.get() == 0 &&
290290
gfxAllocation->isUsed() && this->executionEnvironment.commandStreamReceivers.size() > 0 &&
291-
this->getCommandStreamReceiver(0) && this->getCommandStreamReceiver(0)->getTagAddress() &&
292-
gfxAllocation->getTaskCount(0u) > *this->getCommandStreamReceiver(0)->getTagAddress());
291+
this->getDefaultCommandStreamReceiver(0) && this->getDefaultCommandStreamReceiver(0)->getTagAddress() &&
292+
gfxAllocation->getTaskCount(0u) > *this->getDefaultCommandStreamReceiver(0)->getTagAddress());
293293

294294
if (input->gmm) {
295295
if (input->gmm->isRenderCompressed && wddm->getPageTableManager()) {

unit_tests/command_queue/command_queue_tests.cpp

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -336,36 +336,33 @@ TEST_F(CommandQueueCommandStreamTest, givenCommandStreamReceiverWithReusableAllo
336336
}
337337
TEST_F(CommandQueueCommandStreamTest, givenCommandQueueWhenItIsDestroyedThenCommandStreamIsPutOnTheReusabeList) {
338338
auto cmdQ = new CommandQueue(context.get(), pDevice, 0);
339-
auto memoryManager = pDevice->getMemoryManager();
340339
const auto &commandStream = cmdQ->getCS(100);
341340
auto graphicsAllocation = commandStream.getGraphicsAllocation();
342-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
341+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
343342

344343
//now destroy command queue, heap should go to reusable list
345344
delete cmdQ;
346-
EXPECT_FALSE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
347-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekContains(*graphicsAllocation));
345+
EXPECT_FALSE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
346+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekContains(*graphicsAllocation));
348347
}
349348

350349
TEST_F(CommandQueueCommandStreamTest, CommandQueueWhenAskedForNewCommandStreamStoresOldHeapForReuse) {
351350
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
352351
CommandQueue cmdQ(context.get(), pDevice, props);
353352

354-
auto memoryManager = pDevice->getMemoryManager();
355-
356-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
353+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
357354

358355
const auto &indirectHeap = cmdQ.getCS(100);
359356

360-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
357+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
361358

362359
auto graphicsAllocation = indirectHeap.getGraphicsAllocation();
363360

364361
cmdQ.getCS(10000);
365362

366-
EXPECT_FALSE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
363+
EXPECT_FALSE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
367364

368-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekContains(*graphicsAllocation));
365+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekContains(*graphicsAllocation));
369366
}
370367

371368
TEST_F(CommandQueueCommandStreamTest, givenCommandQueueWhenGetCSIsCalledThenCommandStreamAllocationTypeShouldBeSetToLinearStream) {
@@ -515,8 +512,7 @@ TEST_P(CommandQueueIndirectHeapTest, CommandQueueWhenAskedForNewHeapStoresOldHea
515512
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
516513
CommandQueue cmdQ(context.get(), pDevice, props);
517514

518-
auto memoryManager = pDevice->getMemoryManager();
519-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
515+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
520516

521517
const auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), 100);
522518
auto heapSize = indirectHeap.getAvailableSpace();
@@ -526,9 +522,9 @@ TEST_P(CommandQueueIndirectHeapTest, CommandQueueWhenAskedForNewHeapStoresOldHea
526522
// Request a larger heap than the first.
527523
cmdQ.getIndirectHeap(this->GetParam(), heapSize + 6000);
528524

529-
EXPECT_FALSE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
525+
EXPECT_FALSE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
530526

531-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekContains(*graphicsAllocation));
527+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekContains(*graphicsAllocation));
532528
}
533529

534530
TEST_P(CommandQueueIndirectHeapTest, GivenCommandQueueWithoutHeapAllocationWhenAskedForNewHeapReturnsAcquiresNewAllocationWithoutStoring) {
@@ -537,7 +533,7 @@ TEST_P(CommandQueueIndirectHeapTest, GivenCommandQueueWithoutHeapAllocationWhenA
537533

538534
auto memoryManager = pDevice->getMemoryManager();
539535
auto &csr = pDevice->getUltCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME>();
540-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
536+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
541537

542538
const auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), 100);
543539
auto heapSize = indirectHeap.getAvailableSpace();
@@ -556,21 +552,19 @@ TEST_P(CommandQueueIndirectHeapTest, GivenCommandQueueWithoutHeapAllocationWhenA
556552

557553
TEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWithResourceCachingActiveWhenQueueISDestroyedThenIndirectHeapIsNotOnReuseList) {
558554
auto cmdQ = new CommandQueue(context.get(), pDevice, 0);
559-
auto memoryManager = pDevice->getMemoryManager();
560555
cmdQ->getIndirectHeap(this->GetParam(), 100);
561-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
556+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
562557

563558
//now destroy command queue, heap should go to reusable list
564559
delete cmdQ;
565-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
560+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
566561
}
567562

568563
TEST_P(CommandQueueIndirectHeapTest, GivenCommandQueueWithHeapAllocatedWhenIndirectHeapIsReleasedThenHeapAllocationAndHeapBufferIsSetToNullptr) {
569564
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
570565
MockCommandQueue cmdQ(context.get(), pDevice, props);
571566

572-
auto memoryManager = pDevice->getMemoryManager();
573-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
567+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
574568

575569
const auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), 100);
576570
auto heapSize = indirectHeap.getMaxAvailableSpace();
@@ -614,7 +608,7 @@ TEST_P(CommandQueueIndirectHeapTest, GivenCommandQueueWithHeapWhenGraphicAllocat
614608
cmdQ.releaseIndirectHeap(this->GetParam());
615609

616610
auto memoryManager = pDevice->getMemoryManager();
617-
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getAllocationsForReuse().peekIsEmpty());
611+
EXPECT_TRUE(pDevice->getDefaultEngine().commandStreamReceiver->getAllocationsForReuse().peekIsEmpty());
618612

619613
memoryManager->freeGraphicsMemory(allocation);
620614
}
@@ -671,7 +665,7 @@ HWTEST_F(CommandQueueTests, givenMultipleCommandQueuesWhenMarkerIsEmittedThenGra
671665
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(*platformDevices));
672666
MockContext context(device.get());
673667
std::unique_ptr<CommandQueue> commandQ(new CommandQueue(&context, device.get(), 0));
674-
*device->getTagAddress() = 0;
668+
*device->getDefaultEngine().commandStreamReceiver->getTagAddress() = 0;
675669
commandQ->enqueueMarkerWithWaitList(0, nullptr, nullptr);
676670
commandQ->enqueueMarkerWithWaitList(0, nullptr, nullptr);
677671

unit_tests/command_stream/command_stream_receiver_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ HWTEST_F(CommandStreamReceiverTest, givenPtrAndSizeThatDoNotMeetL3CriteriaWhenMa
170170

171171
TEST_F(CommandStreamReceiverTest, memoryManagerHasAccessToCSR) {
172172
auto *memoryManager = commandStreamReceiver->getMemoryManager();
173-
EXPECT_EQ(commandStreamReceiver, memoryManager->getCommandStreamReceiver(0));
173+
EXPECT_EQ(commandStreamReceiver, memoryManager->getDefaultCommandStreamReceiver(0));
174174
}
175175

176176
HWTEST_F(CommandStreamReceiverTest, whenStoreAllocationThenStoredAllocationHasTaskCountFromCsr) {

0 commit comments

Comments
 (0)