mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 08:07:19 +08:00
Reverse logic of creating Memory Manager - part 1
-remove CSR::createMemoryManager method -create MM from platform before creating devices Change-Id: I0e7f091c53b0e60ae7101e82a305253af626330e Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
This commit is contained in:
@@ -95,15 +95,13 @@ Device::~Device() {
|
||||
executionEnvironment->sourceLevelDebugger->notifyDeviceDestruction();
|
||||
}
|
||||
|
||||
if (executionEnvironment->memoryManager) {
|
||||
if (preemptionAllocation) {
|
||||
executionEnvironment->memoryManager->freeGraphicsMemory(preemptionAllocation);
|
||||
preemptionAllocation = nullptr;
|
||||
}
|
||||
executionEnvironment->memoryManager->waitForDeletions();
|
||||
|
||||
alignedFree(this->slmWindowStartAddress);
|
||||
if (preemptionAllocation) {
|
||||
executionEnvironment->memoryManager->freeGraphicsMemory(preemptionAllocation);
|
||||
preemptionAllocation = nullptr;
|
||||
}
|
||||
executionEnvironment->memoryManager->waitForDeletions();
|
||||
|
||||
alignedFree(this->slmWindowStartAddress);
|
||||
executionEnvironment->decRefInternal();
|
||||
}
|
||||
|
||||
@@ -174,7 +172,7 @@ bool Device::createEngines(const HardwareInfo *pHwInfo) {
|
||||
if (!executionEnvironment->initializeCommandStreamReceiver(pHwInfo, getDeviceIndex(), deviceCsrIndex)) {
|
||||
return false;
|
||||
}
|
||||
executionEnvironment->initializeMemoryManager(getEnabled64kbPages(), enableLocalMemory, getDeviceIndex(), deviceCsrIndex);
|
||||
executionEnvironment->initializeMemoryManager(getEnabled64kbPages(), enableLocalMemory);
|
||||
|
||||
auto commandStreamReceiver = executionEnvironment->commandStreamReceivers[getDeviceIndex()][deviceCsrIndex].get();
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@ class Device : public BaseObject<_cl_device_id> {
|
||||
std::string deviceExtensions;
|
||||
std::string name;
|
||||
bool getEnabled64kbPages() const;
|
||||
static bool getEnabled64kbPages(const HardwareInfo &hwInfo);
|
||||
bool isSourceLevelDebuggerActive() const;
|
||||
SourceLevelDebugger *getSourceLevelDebugger() { return executionEnvironment->sourceLevelDebugger.get(); }
|
||||
ExecutionEnvironment *getExecutionEnvironment() const { return executionEnvironment; }
|
||||
|
||||
@@ -43,6 +43,10 @@ static constexpr cl_device_fp_config defaultFpFlags = static_cast<cl_device_fp_c
|
||||
CL_FP_FMA);
|
||||
|
||||
bool Device::getEnabled64kbPages() const {
|
||||
return getEnabled64kbPages(this->hwInfo);
|
||||
}
|
||||
|
||||
bool Device::getEnabled64kbPages(const HardwareInfo &hwInfo) {
|
||||
if (DebugManager.flags.Enable64kbpages.get() == -1) {
|
||||
// assign value according to os and hw configuration
|
||||
return OSInterface::osEnabled64kbPages && hwInfo.capabilityTable.ftr64KBpages;
|
||||
|
||||
Reference in New Issue
Block a user