2018-01-08 11:07:46 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2021 Intel Corporation
|
2018-01-08 11:07:46 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-01-08 11:07:46 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-01-21 20:10:13 +08:00
|
|
|
#include "shared/test/common/fixtures/preemption_fixture.h"
|
2018-01-08 11:07:46 +08:00
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_stream/preemption.h"
|
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2021-01-21 20:10:13 +08:00
|
|
|
#include "shared/test/common/cmd_parse/hw_parse.h"
|
|
|
|
#include "shared/test/common/mocks/mock_device.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "test.h"
|
2018-01-08 11:07:46 +08:00
|
|
|
|
|
|
|
#include "gtest/gtest.h"
|
2021-10-13 22:10:39 +08:00
|
|
|
#include "patch_g7.h"
|
2018-01-08 11:07:46 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2018-01-08 11:07:46 +08:00
|
|
|
|
|
|
|
DevicePreemptionTests::DevicePreemptionTests() = default;
|
|
|
|
DevicePreemptionTests::~DevicePreemptionTests() = default;
|
|
|
|
|
|
|
|
void DevicePreemptionTests::SetUp() {
|
|
|
|
if (dbgRestore == nullptr) {
|
|
|
|
dbgRestore.reset(new DebugManagerStateRestore());
|
|
|
|
}
|
2020-06-10 18:47:58 +08:00
|
|
|
|
|
|
|
device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
2021-10-13 22:10:39 +08:00
|
|
|
executionEnvironment.reset(new iOpenCL::SPatchExecutionEnvironment);
|
|
|
|
memset(executionEnvironment.get(), 0, sizeof(iOpenCL::SPatchExecutionEnvironment));
|
2018-01-08 11:07:46 +08:00
|
|
|
|
|
|
|
ASSERT_NE(nullptr, device);
|
2019-08-05 14:07:29 +08:00
|
|
|
|
2020-03-04 15:51:02 +08:00
|
|
|
waTable = &device->getRootDeviceEnvironment().getMutableHardwareInfo()->workaroundTable;
|
2018-01-08 11:07:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void DevicePreemptionTests::TearDown() {
|
|
|
|
dbgRestore.reset();
|
|
|
|
}
|