mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Move setting external memory managers to mock layers.
Change-Id: I335fd35269da9093c9e744c2735215e8d561098c
This commit is contained in:
committed by
sys_ocldev
parent
239ebf9eab
commit
366a12e3ce
@@ -132,7 +132,7 @@ bool Device::createDeviceImpl(const HardwareInfo *pHwInfo, Device &outDevice) {
|
||||
return false;
|
||||
}
|
||||
|
||||
executionEnvironment->initializeMemoryManager(outDevice.executionEnvironment->memoryManager.get(), outDevice.getEnabled64kbPages());
|
||||
executionEnvironment->initializeMemoryManager(outDevice.getEnabled64kbPages());
|
||||
|
||||
CommandStreamReceiver *commandStreamReceiver = executionEnvironment->commandStreamReceiver.get();
|
||||
if (!commandStreamReceiver->initializeTagAllocation()) {
|
||||
|
||||
@@ -53,11 +53,7 @@ class Device : public BaseObject<_cl_device_id> {
|
||||
static T *create(const HardwareInfo *pHwInfo, ExecutionEnvironment *execEnv) {
|
||||
pHwInfo = getDeviceInitHwInfo(pHwInfo);
|
||||
T *device = new T(*pHwInfo, execEnv);
|
||||
if (false == createDeviceImpl(pHwInfo, *device)) {
|
||||
delete device;
|
||||
return nullptr;
|
||||
}
|
||||
return device;
|
||||
return createDeviceInternals(pHwInfo, device);
|
||||
}
|
||||
|
||||
Device &operator=(const Device &) = delete;
|
||||
@@ -139,6 +135,15 @@ class Device : public BaseObject<_cl_device_id> {
|
||||
Device() = delete;
|
||||
Device(const HardwareInfo &hwInfo, ExecutionEnvironment *executionEnvironment);
|
||||
|
||||
template <typename T>
|
||||
static T *createDeviceInternals(const HardwareInfo *pHwInfo, T *device) {
|
||||
if (false == createDeviceImpl(pHwInfo, *device)) {
|
||||
delete device;
|
||||
return nullptr;
|
||||
}
|
||||
return device;
|
||||
}
|
||||
|
||||
static bool createDeviceImpl(const HardwareInfo *pHwInfo, Device &outDevice);
|
||||
static const HardwareInfo *getDeviceInitHwInfo(const HardwareInfo *pHwInfoIn);
|
||||
MOCKABLE_VIRTUAL void initializeCaps();
|
||||
|
||||
Reference in New Issue
Block a user