mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 01:48:50 +08:00
Before performing gpu device reset, first all level zero resources and gpu device specific resources have to be cleaned up. Also as after device reset, state of gpu device would be lost. Hence after performing gpu device reset, level zero device have to be reinitialized by querying gpu device again. This change is aimed at reinitializing the level zero resources after gpu device reset, so that user could continue using level zero devices after device reset. Related-To: LOCI-2627 Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
47 lines
1.4 KiB
C++
47 lines
1.4 KiB
C++
/*
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "shared/source/utilities/reference_tracked_object.h"
|
|
|
|
#include <vector>
|
|
|
|
namespace NEO {
|
|
class DirectSubmissionController;
|
|
class MemoryManager;
|
|
struct OsEnvironment;
|
|
struct RootDeviceEnvironment;
|
|
|
|
class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment> {
|
|
|
|
public:
|
|
ExecutionEnvironment();
|
|
~ExecutionEnvironment() override;
|
|
|
|
MOCKABLE_VIRTUAL bool initializeMemoryManager();
|
|
void calculateMaxOsContextCount();
|
|
virtual void prepareRootDeviceEnvironments(uint32_t numRootDevices);
|
|
void prepareRootDeviceEnvironment(const uint32_t rootDeviceIndexForReInit);
|
|
void parseAffinityMask();
|
|
void sortNeoDevices();
|
|
void setDebuggingEnabled() {
|
|
debuggingEnabled = true;
|
|
}
|
|
bool isDebuggingEnabled() { return debuggingEnabled; }
|
|
DirectSubmissionController *initializeDirectSubmissionController();
|
|
|
|
std::unique_ptr<MemoryManager> memoryManager;
|
|
std::unique_ptr<DirectSubmissionController> directSubmissionController;
|
|
std::unique_ptr<OsEnvironment> osEnvironment;
|
|
std::vector<std::unique_ptr<RootDeviceEnvironment>> rootDeviceEnvironments;
|
|
void releaseRootDeviceEnvironmentResources(RootDeviceEnvironment *rootDeviceEnvironment);
|
|
|
|
protected:
|
|
bool debuggingEnabled = false;
|
|
};
|
|
} // namespace NEO
|