mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 09:58:55 +08:00
Change-Id: Ib61e987388ba14b721a573e3e84332a7f6c9ef9c Signed-off-by: Konstanty Misiak <konstanty.misiak@intel.com>
38 lines
1021 B
C++
38 lines
1021 B
C++
/*
|
|
* Copyright (C) 2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/test/unit_test/fixtures/device_fixture.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);
|
|
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::createWithUsDeviceId(unsigned short usDeviceId) {
|
|
hardwareInfo = *defaultHwInfo;
|
|
hardwareInfo.platform.usDeviceID = usDeviceId;
|
|
return MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hardwareInfo);
|
|
}
|
|
} // namespace NEO
|