2019-03-19 11:57:45 +01:00
|
|
|
/*
|
2020-02-03 16:18:21 +01:00
|
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
2019-03-19 11:57:45 +01:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
2020-02-24 01:01:38 +01:00
|
|
|
#include "shared/test/unit_test/helpers/default_hw_info.h"
|
2020-03-25 10:51:31 +01:00
|
|
|
#include "shared/test/unit_test/tests_configuration.h"
|
2020-02-24 10:22:30 +01:00
|
|
|
|
2020-02-22 22:50:57 +01:00
|
|
|
#include "opencl/source/platform/platform.h"
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_aub_center.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_aub_manager.h"
|
2020-03-17 14:25:44 +01:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
2020-02-22 09:28:27 +01:00
|
|
|
|
2019-03-19 11:57:45 +01:00
|
|
|
namespace NEO {
|
|
|
|
struct MockAubCenterFixture {
|
|
|
|
|
|
|
|
MockAubCenterFixture() = default;
|
|
|
|
MockAubCenterFixture(CommandStreamReceiverType commandStreamReceiverType) : commandStreamReceiverType(commandStreamReceiverType){};
|
|
|
|
|
|
|
|
void SetUp() {
|
2020-02-03 16:18:21 +01:00
|
|
|
setMockAubCenter(*platform()->peekExecutionEnvironment()->rootDeviceEnvironments[0], commandStreamReceiverType);
|
2019-03-19 11:57:45 +01:00
|
|
|
}
|
|
|
|
void TearDown() {
|
|
|
|
}
|
|
|
|
|
2019-11-15 09:59:48 +01:00
|
|
|
static void setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment) {
|
|
|
|
setMockAubCenter(rootDeviceEnvironment, CommandStreamReceiverType::CSR_AUB);
|
2019-03-19 11:57:45 +01:00
|
|
|
}
|
2019-11-15 09:59:48 +01:00
|
|
|
static void setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment, CommandStreamReceiverType commandStreamReceiverType) {
|
2019-03-19 11:57:45 +01:00
|
|
|
if (testMode != TestMode::AubTests && testMode != TestMode::AubTestsWithTbx) {
|
2020-03-24 17:04:08 +01:00
|
|
|
auto mockAubCenter = std::make_unique<MockAubCenter>(defaultHwInfo.get(), false, "", commandStreamReceiverType);
|
2019-03-19 11:57:45 +01:00
|
|
|
mockAubCenter->aubManager = std::make_unique<MockAubManager>();
|
2019-11-15 09:59:48 +01:00
|
|
|
rootDeviceEnvironment.aubCenter.reset(mockAubCenter.release());
|
2019-03-19 11:57:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
CommandStreamReceiverType commandStreamReceiverType = CommandStreamReceiverType::CSR_AUB;
|
|
|
|
};
|
|
|
|
} // namespace NEO
|