mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-01 12:33:12 +08:00
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> - Added HwInfoConfig getter in RootDeviceEnvironment, which temporarily takes HwInfoConfig from the global array - use HwInfoConfig from RootDeviceEnvironment to call ConfigureHardwareCustom function - Added getHwInfoConfig in DeviceFixture - ConfigureHardwareCustom function and few others changed to const - Small code cleanup
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
/*
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/test/common/fixtures/device_fixture.h"
|
|
|
|
#include "shared/source/built_ins/sip.h"
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
namespace NEO {
|
|
void DeviceFixture::setUp() {
|
|
hardwareInfo = *defaultHwInfo;
|
|
setUpImpl(&hardwareInfo);
|
|
}
|
|
|
|
void DeviceFixture::setUpImpl(const NEO::HardwareInfo *hardwareInfo) {
|
|
pDevice = MockDevice::createWithNewExecutionEnvironment<MockDevice>(hardwareInfo, rootDeviceIndex);
|
|
ASSERT_NE(nullptr, pDevice);
|
|
|
|
auto &commandStreamReceiver = pDevice->getGpgpuCommandStreamReceiver();
|
|
pTagMemory = commandStreamReceiver.getTagAddress();
|
|
ASSERT_NE(nullptr, const_cast<uint32_t *>(pTagMemory));
|
|
}
|
|
|
|
void DeviceFixture::tearDown() {
|
|
delete pDevice;
|
|
pDevice = nullptr;
|
|
}
|
|
|
|
MockDevice *DeviceFixture::createWithUsDeviceIdRevId(unsigned short usDeviceId, unsigned short usRevId) {
|
|
hardwareInfo = *defaultHwInfo;
|
|
hardwareInfo.platform.usDeviceID = usDeviceId;
|
|
hardwareInfo.platform.usRevId = usRevId;
|
|
return MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hardwareInfo);
|
|
}
|
|
|
|
const HwInfoConfig &DeviceFixture::getHwInfoConfig() const {
|
|
return this->pDevice->getRootDeviceEnvironment().getHwInfoConfig();
|
|
}
|
|
|
|
} // namespace NEO
|