mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 18:06:32 +08:00
Command stream receiver: use memory manager from execution environment
Change-Id: I236218a73bd7dac6e5744e3596f146b77b5ca1c8 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
97c56b9de0
commit
4f028d13a1
@@ -21,7 +21,6 @@ MockDevice::MockDevice(const HardwareInfo &hwInfo)
|
||||
CommandStreamReceiver *commandStreamReceiver = createCommandStream(&hwInfo, *this->executionEnvironment);
|
||||
executionEnvironment->commandStreamReceivers.resize(getDeviceIndex() + 1);
|
||||
executionEnvironment->commandStreamReceivers[getDeviceIndex()].reset(commandStreamReceiver);
|
||||
commandStreamReceiver->setMemoryManager(this->mockMemoryManager.get());
|
||||
this->executionEnvironment->memoryManager = std::move(this->mockMemoryManager);
|
||||
this->commandStreamReceiver = commandStreamReceiver;
|
||||
}
|
||||
@@ -33,15 +32,6 @@ OCLRT::MockDevice::MockDevice(const HardwareInfo &hwInfo, ExecutionEnvironment *
|
||||
mockWaTable = *hwInfo.pWaTable;
|
||||
}
|
||||
|
||||
void MockDevice::setMemoryManager(MemoryManager *memoryManager) {
|
||||
executionEnvironment->memoryManager.reset(memoryManager);
|
||||
for (auto &commandStreamReceiver : executionEnvironment->commandStreamReceivers) {
|
||||
if (commandStreamReceiver) {
|
||||
commandStreamReceiver->setMemoryManager(memoryManager);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MockDevice::setOSTime(OSTime *osTime) {
|
||||
this->osTime.reset(osTime);
|
||||
};
|
||||
@@ -55,13 +45,11 @@ bool MockDevice::hasDriverInfo() {
|
||||
};
|
||||
|
||||
void MockDevice::injectMemoryManager(MemoryManager *memoryManager) {
|
||||
executionEnvironment->commandStreamReceivers[getDeviceIndex()]->setMemoryManager(memoryManager);
|
||||
setMemoryManager(memoryManager);
|
||||
executionEnvironment->memoryManager.reset(memoryManager);
|
||||
}
|
||||
|
||||
void MockDevice::resetCommandStreamReceiver(CommandStreamReceiver *newCsr) {
|
||||
executionEnvironment->commandStreamReceivers[getDeviceIndex()].reset(newCsr);
|
||||
executionEnvironment->commandStreamReceivers[getDeviceIndex()]->setMemoryManager(executionEnvironment->memoryManager.get());
|
||||
executionEnvironment->commandStreamReceivers[getDeviceIndex()]->initializeTagAllocation();
|
||||
executionEnvironment->commandStreamReceivers[getDeviceIndex()]->setPreemptionCsrAllocation(preemptionAllocation);
|
||||
this->commandStreamReceiver = newCsr;
|
||||
@@ -69,11 +57,6 @@ void MockDevice::resetCommandStreamReceiver(CommandStreamReceiver *newCsr) {
|
||||
this->tagAddress = executionEnvironment->commandStreamReceivers[getDeviceIndex()]->getTagAddress();
|
||||
}
|
||||
|
||||
OCLRT::FailMemoryManager::FailMemoryManager() {
|
||||
agnostic = nullptr;
|
||||
fail = 0;
|
||||
}
|
||||
|
||||
OCLRT::FailMemoryManager::FailMemoryManager(int32_t fail) {
|
||||
allocations.reserve(fail);
|
||||
agnostic = new OsAgnosticMemoryManager(false, false, executionEnvironment);
|
||||
|
||||
Reference in New Issue
Block a user