2018-11-11 05:25:48 +08:00
|
|
|
/*
|
2019-02-08 22:08:35 +08:00
|
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
2018-11-11 05:25:48 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "runtime/execution_environment/execution_environment.h"
|
2019-07-24 20:07:14 +08:00
|
|
|
#include "runtime/helpers/hw_helper.h"
|
2019-02-08 22:08:35 +08:00
|
|
|
#include "runtime/helpers/options.h"
|
2019-03-19 18:57:45 +08:00
|
|
|
#include "unit_tests/fixtures/mock_aub_center_fixture.h"
|
2019-02-08 22:08:35 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-11-11 05:25:48 +08:00
|
|
|
struct MockExecutionEnvironment : ExecutionEnvironment {
|
|
|
|
MockExecutionEnvironment() = default;
|
2019-03-19 18:57:45 +08:00
|
|
|
MockExecutionEnvironment(const HardwareInfo *hwInfo) : MockExecutionEnvironment(hwInfo, true) {}
|
|
|
|
MockExecutionEnvironment(const HardwareInfo *hwInfo, bool useMockAubCenter) : useMockAubCenter(useMockAubCenter) {
|
2019-05-06 18:33:44 +08:00
|
|
|
if (hwInfo) {
|
|
|
|
setHwInfo(hwInfo);
|
|
|
|
}
|
2019-01-23 18:59:54 +08:00
|
|
|
}
|
|
|
|
void initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) override {
|
2019-02-21 04:48:06 +08:00
|
|
|
if (!initAubCenterCalled) {
|
|
|
|
initAubCenterCalled = true;
|
|
|
|
localMemoryEnabledReceived = localMemoryEnabled;
|
|
|
|
aubFileNameReceived = aubFileName;
|
|
|
|
}
|
2019-03-19 18:57:45 +08:00
|
|
|
if (useMockAubCenter) {
|
|
|
|
MockAubCenterFixture::setMockAubCenter(this);
|
|
|
|
}
|
2019-01-23 18:59:54 +08:00
|
|
|
ExecutionEnvironment::initAubCenter(localMemoryEnabled, aubFileName, csrType);
|
2018-11-11 05:25:48 +08:00
|
|
|
}
|
|
|
|
bool initAubCenterCalled = false;
|
2018-11-26 06:58:12 +08:00
|
|
|
bool localMemoryEnabledReceived = false;
|
|
|
|
std::string aubFileNameReceived = "";
|
2019-03-19 18:57:45 +08:00
|
|
|
bool useMockAubCenter = true;
|
2019-07-24 20:07:14 +08:00
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|