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