2018-06-22 18:54:33 +08:00
|
|
|
/*
|
2020-01-07 14:42:40 +08:00
|
|
|
* Copyright (C) 2018-2020 Intel Corporation
|
2018-09-18 15:11:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-06-27 17:35:37 +08:00
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/utilities/reference_tracked_object.h"
|
2018-06-22 18:54:33 +08:00
|
|
|
|
2019-11-05 20:38:20 +08:00
|
|
|
#include <vector>
|
2018-08-01 15:06:46 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-07-11 22:47:49 +08:00
|
|
|
class MemoryManager;
|
2020-03-17 14:26:46 +08:00
|
|
|
struct OsEnvironment;
|
2019-11-15 16:59:48 +08:00
|
|
|
struct RootDeviceEnvironment;
|
2018-08-21 21:47:21 +08:00
|
|
|
|
2018-06-22 18:54:33 +08:00
|
|
|
class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment> {
|
2018-07-12 17:45:02 +08:00
|
|
|
|
2018-06-27 17:35:37 +08:00
|
|
|
public:
|
2018-07-03 16:00:12 +08:00
|
|
|
ExecutionEnvironment();
|
2018-06-27 17:35:37 +08:00
|
|
|
~ExecutionEnvironment() override;
|
2018-07-23 18:23:48 +08:00
|
|
|
|
2019-03-15 17:22:35 +08:00
|
|
|
void initializeMemoryManager();
|
2019-12-17 15:11:16 +08:00
|
|
|
void calculateMaxOsContextCount();
|
2019-11-15 16:59:48 +08:00
|
|
|
void prepareRootDeviceEnvironments(uint32_t numRootDevices);
|
2020-07-13 21:14:16 +08:00
|
|
|
void setPerContextMemorySpace() {
|
|
|
|
requirePerContextMemorySpace = true;
|
|
|
|
}
|
|
|
|
bool isPerContextMemorySpaceRequired() { return requirePerContextMemorySpace; }
|
2018-07-23 18:23:48 +08:00
|
|
|
|
2018-07-11 22:47:49 +08:00
|
|
|
std::unique_ptr<MemoryManager> memoryManager;
|
2020-03-17 14:26:46 +08:00
|
|
|
std::unique_ptr<OsEnvironment> osEnvironment;
|
2019-11-15 16:59:48 +08:00
|
|
|
std::vector<std::unique_ptr<RootDeviceEnvironment>> rootDeviceEnvironments;
|
2020-07-13 21:14:16 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool requirePerContextMemorySpace = false;
|
2018-06-22 18:54:33 +08:00
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|