mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Move HardwareInfo ownership to ExecutionEnvironment [1/n]
Change-Id: I5e5b4cc45947a8841282c7d431fb69d9c397a2d4 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
b2aee82f41
commit
bb80d327c7
@ -6,11 +6,11 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "runtime/helpers/hw_info.h"
|
||||
#include "runtime/memory_manager/internal_allocation_storage.h"
|
||||
#include "test.h"
|
||||
#include "unit_tests/fixtures/buffer_fixture.h"
|
||||
#include "unit_tests/helpers/execution_environment_helper.h"
|
||||
#include "unit_tests/helpers/hw_info_helper.h"
|
||||
#include "unit_tests/helpers/hw_parse.h"
|
||||
#include "unit_tests/mocks/mock_command_queue.h"
|
||||
#include "unit_tests/mocks/mock_csr.h"
|
||||
@ -43,7 +43,7 @@ struct BufferEnqueueFixture : public HardwareParse,
|
||||
memoryManager = new MockMemoryManager(*executionEnvironment);
|
||||
executionEnvironment->memoryManager.reset(memoryManager);
|
||||
|
||||
device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(hwInfo, executionEnvironment, 0));
|
||||
device = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0));
|
||||
|
||||
context = std::make_unique<MockContext>(device.get());
|
||||
|
||||
@ -61,7 +61,7 @@ struct BufferEnqueueFixture : public HardwareParse,
|
||||
|
||||
protected:
|
||||
const size_t bufferSizeInDwords = 64;
|
||||
HwInfoHelper hwInfoHelper;
|
||||
HardwareInfo hwInfoHelper;
|
||||
HardwareInfo *hwInfo = nullptr;
|
||||
ExecutionEnvironment *executionEnvironment;
|
||||
cl_queue_properties properties = {};
|
||||
|
@ -31,9 +31,7 @@ void DeviceFixture::TearDown() {
|
||||
|
||||
MockDevice *DeviceFixture::createWithUsDeviceId(unsigned short usDeviceId) {
|
||||
hwInfoHelper = *platformDevices[0];
|
||||
platformHelper = *platformDevices[0]->pPlatform;
|
||||
platformHelper.usDeviceID = usDeviceId;
|
||||
hwInfoHelper.pPlatform = &platformHelper;
|
||||
hwInfoHelper.pPlatform.usDeviceID = usDeviceId;
|
||||
return MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfoHelper);
|
||||
}
|
||||
} // namespace NEO
|
||||
|
@ -15,6 +15,6 @@ void DeviceInstrumentationFixture::SetUp(bool instrumentation) {
|
||||
ExecutionEnvironment *executionEnvironment = getExecutionEnvironmentImpl(hwInfo);
|
||||
if (instrumentation)
|
||||
hwInfo->capabilityTable.instrumentationEnabled = true;
|
||||
device = std::unique_ptr<Device>(Device::create<Device>(&hwInfo[0], executionEnvironment, 0));
|
||||
device = std::unique_ptr<Device>(Device::create<Device>(executionEnvironment, 0));
|
||||
}
|
||||
} // namespace NEO
|
||||
} // namespace NEO
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "runtime/helpers/options.h"
|
||||
#include "runtime/mem_obj/image.h"
|
||||
#include "runtime/platform/platform.h"
|
||||
#include "unit_tests/helpers/hw_info_helper.h"
|
||||
#include "unit_tests/mocks/mock_context.h"
|
||||
|
||||
#include "CL/cl.h"
|
||||
@ -117,10 +116,10 @@ class ImageClearColorFixture {
|
||||
using AUXILIARY_SURFACE_MODE = typename FamilyType::RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE;
|
||||
|
||||
void SetUp() {
|
||||
hwInfoHelper.hwInfo.capabilityTable.ftrRenderCompressedImages = true;
|
||||
hwInfoHelper.capabilityTable.ftrRenderCompressedImages = true;
|
||||
|
||||
NEO::platformImpl.reset();
|
||||
NEO::constructPlatform()->peekExecutionEnvironment()->setHwInfo(&hwInfoHelper.hwInfo);
|
||||
NEO::constructPlatform()->peekExecutionEnvironment()->setHwInfo(&hwInfoHelper);
|
||||
NEO::platform()->peekExecutionEnvironment()->initGmm();
|
||||
|
||||
surfaceState = FamilyType::cmdInitRenderSurfaceState;
|
||||
@ -135,7 +134,7 @@ class ImageClearColorFixture {
|
||||
}
|
||||
|
||||
RENDER_SURFACE_STATE surfaceState;
|
||||
HwInfoHelper hwInfoHelper;
|
||||
NEO::HardwareInfo hwInfoHelper = **NEO::platformDevices;
|
||||
|
||||
protected:
|
||||
MockContext context;
|
||||
|
@ -27,7 +27,7 @@ class MemoryAllocatorFixture : public MemoryManagementFixture {
|
||||
memoryManager = new MockMemoryManager(false, false, *executionEnvironment);
|
||||
executionEnvironment->memoryManager.reset(memoryManager);
|
||||
csr = memoryManager->getDefaultCommandStreamReceiver(0);
|
||||
auto engineType = HwHelper::get(platformDevices[0]->pPlatform->eRenderCoreFamily).getGpgpuEngineInstances()[0];
|
||||
auto engineType = HwHelper::get(platformDevices[0]->pPlatform.eRenderCoreFamily).getGpgpuEngineInstances()[0];
|
||||
auto osContext = memoryManager->createAndRegisterOsContext(csr, engineType, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
csr->setupContext(*osContext);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ void MemoryManagerWithCsrFixture::SetUp() {
|
||||
csr->tagAddress = ¤tGpuTag;
|
||||
executionEnvironment.commandStreamReceivers.resize(1);
|
||||
executionEnvironment.commandStreamReceivers[0].push_back(std::unique_ptr<CommandStreamReceiver>(csr));
|
||||
auto engine = HwHelper::get(platformDevices[0]->pPlatform->eRenderCoreFamily).getGpgpuEngineInstances()[0];
|
||||
auto engine = HwHelper::get(platformDevices[0]->pPlatform.eRenderCoreFamily).getGpgpuEngineInstances()[0];
|
||||
auto osContext = memoryManager->createAndRegisterOsContext(csr, engine, 1, PreemptionHelper::getDefaultPreemptionMode(*platformDevices[0]), false);
|
||||
csr->setupContext(*osContext);
|
||||
}
|
||||
|
Reference in New Issue
Block a user