2018-11-11 05:25:48 +08:00
|
|
|
/*
|
2024-06-19 19:04:27 +08:00
|
|
|
* Copyright (C) 2018-2024 Intel Corporation
|
2018-11-11 05:25:48 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/execution_environment/execution_environment.h"
|
2022-11-16 22:01:52 +08:00
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
2019-02-08 22:08:35 +08:00
|
|
|
|
2023-11-21 01:47:53 +08:00
|
|
|
#include <optional>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2019-11-15 16:59:48 +08:00
|
|
|
|
2024-06-19 19:04:27 +08:00
|
|
|
class BuiltIns;
|
|
|
|
|
2019-11-15 16:59:48 +08:00
|
|
|
struct MockRootDeviceEnvironment : public RootDeviceEnvironment {
|
2023-11-21 01:47:53 +08:00
|
|
|
using BaseClass = RootDeviceEnvironment;
|
2023-06-23 22:26:00 +08:00
|
|
|
using RootDeviceEnvironment::hwInfo;
|
2023-03-01 05:08:09 +08:00
|
|
|
using RootDeviceEnvironment::isDummyAllocationInitialized;
|
2023-09-13 16:37:04 +08:00
|
|
|
using RootDeviceEnvironment::isWddmOnLinuxEnable;
|
2019-11-15 16:59:48 +08:00
|
|
|
using RootDeviceEnvironment::RootDeviceEnvironment;
|
2023-11-21 01:47:53 +08:00
|
|
|
~MockRootDeviceEnvironment() override;
|
2019-11-15 16:59:48 +08:00
|
|
|
|
2022-11-16 22:01:52 +08:00
|
|
|
void initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) override;
|
2023-11-21 01:47:53 +08:00
|
|
|
bool initOsInterface(std::unique_ptr<HwDeviceId> &&hwDeviceId, uint32_t rootDeviceIndex) override;
|
2023-11-28 23:15:25 +08:00
|
|
|
bool initAilConfiguration() override;
|
2023-11-21 01:47:53 +08:00
|
|
|
|
2024-06-19 19:04:27 +08:00
|
|
|
static void resetBuiltins(RootDeviceEnvironment *rootDeviceEnvironment, BuiltIns *newValue);
|
|
|
|
|
2023-11-21 01:47:53 +08:00
|
|
|
std::vector<bool> initOsInterfaceResults;
|
|
|
|
uint32_t initOsInterfaceCalled = 0u;
|
|
|
|
std::optional<uint32_t> initOsInterfaceExpectedCallCount;
|
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;
|
2023-11-28 23:15:25 +08:00
|
|
|
std::optional<bool> ailInitializationResult{true};
|
2019-07-24 20:07:14 +08:00
|
|
|
};
|
2019-11-15 16:59:48 +08:00
|
|
|
|
|
|
|
struct MockExecutionEnvironment : ExecutionEnvironment {
|
2023-08-04 17:10:42 +08:00
|
|
|
using ExecutionEnvironment::adjustCcsCountImpl;
|
2021-07-30 17:56:58 +08:00
|
|
|
using ExecutionEnvironment::directSubmissionController;
|
2023-08-04 17:10:42 +08:00
|
|
|
using ExecutionEnvironment::rootDeviceEnvironments;
|
2021-07-30 17:56:58 +08:00
|
|
|
|
2019-11-15 16:59:48 +08:00
|
|
|
~MockExecutionEnvironment() override = default;
|
2022-11-16 22:01:52 +08:00
|
|
|
MockExecutionEnvironment();
|
|
|
|
MockExecutionEnvironment(const HardwareInfo *hwInfo);
|
|
|
|
MockExecutionEnvironment(const HardwareInfo *hwInfo, bool useMockAubCenter, uint32_t numRootDevices);
|
|
|
|
void initGmm();
|
2019-11-15 16:59:48 +08:00
|
|
|
};
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|