mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Revert "refactor: Store AIL in root device environment"
This reverts commit 02ef252b7d.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c68f55e4f6
commit
27000c06cb
@@ -10,7 +10,6 @@
|
||||
#include "igfxfmid.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
@@ -44,24 +43,14 @@ enum class AILEnumeration : uint32_t {
|
||||
AIL_MAX_OPTIONS_COUNT
|
||||
};
|
||||
|
||||
class AILConfiguration;
|
||||
using AILConfigurationCreateFunctionType = std::unique_ptr<AILConfiguration> (*)();
|
||||
extern AILConfigurationCreateFunctionType ailConfigurationFactory[IGFX_MAX_PRODUCT];
|
||||
|
||||
class AILConfiguration {
|
||||
public:
|
||||
static std::unique_ptr<AILConfiguration> create(PRODUCT_FAMILY product) {
|
||||
auto ailConfigurationCreateFunction = ailConfigurationFactory[product];
|
||||
if (ailConfigurationCreateFunction == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
auto ailConfiguration = ailConfigurationCreateFunction();
|
||||
return ailConfiguration;
|
||||
}
|
||||
AILConfiguration() = default;
|
||||
|
||||
MOCKABLE_VIRTUAL bool initProcessExecutableName();
|
||||
|
||||
static AILConfiguration *get(PRODUCT_FAMILY productFamily);
|
||||
|
||||
virtual void apply(RuntimeCapabilityTable &runtimeCapabilityTable);
|
||||
|
||||
virtual void modifyKernelIfRequired(std::string &kernel) = 0;
|
||||
@@ -70,8 +59,6 @@ class AILConfiguration {
|
||||
|
||||
virtual bool isContextSyncFlagRequired() = 0;
|
||||
|
||||
virtual ~AILConfiguration() = default;
|
||||
|
||||
protected:
|
||||
virtual void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) = 0;
|
||||
std::string processName;
|
||||
@@ -80,13 +67,15 @@ class AILConfiguration {
|
||||
MOCKABLE_VIRTUAL bool isKernelHashCorrect(const std::string &kernelSources, uint64_t expectedHash) const;
|
||||
};
|
||||
|
||||
extern AILConfiguration *ailConfigurationTable[IGFX_MAX_PRODUCT];
|
||||
|
||||
extern const std::set<std::string_view> applicationsContextSyncFlag;
|
||||
|
||||
template <PRODUCT_FAMILY Product>
|
||||
class AILConfigurationHw : public AILConfiguration {
|
||||
public:
|
||||
static std::unique_ptr<AILConfiguration> create() {
|
||||
auto ailConfiguration = std::unique_ptr<AILConfiguration>(new AILConfigurationHw());
|
||||
static AILConfigurationHw<Product> &get() {
|
||||
static AILConfigurationHw<Product> ailConfiguration;
|
||||
return ailConfiguration;
|
||||
}
|
||||
|
||||
@@ -100,8 +89,7 @@ class AILConfigurationHw : public AILConfiguration {
|
||||
template <PRODUCT_FAMILY product>
|
||||
struct EnableAIL {
|
||||
EnableAIL() {
|
||||
auto ailConfigurationCreateFunction = AILConfigurationHw<product>::create;
|
||||
ailConfigurationFactory[product] = ailConfigurationCreateFunction;
|
||||
ailConfigurationTable[product] = &AILConfigurationHw<product>::get();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,11 @@ std::map<std::string_view, std::vector<AILEnumeration>> applicationMapMTL = {{"s
|
||||
|
||||
const std::set<std::string_view> applicationsContextSyncFlag = {};
|
||||
|
||||
AILConfigurationCreateFunctionType ailConfigurationFactory[IGFX_MAX_PRODUCT];
|
||||
AILConfiguration *ailConfigurationTable[IGFX_MAX_PRODUCT] = {};
|
||||
|
||||
AILConfiguration *AILConfiguration::get(PRODUCT_FAMILY productFamily) {
|
||||
return ailConfigurationTable[productFamily];
|
||||
}
|
||||
|
||||
void AILConfiguration::apply(RuntimeCapabilityTable &runtimeCapabilityTable) {
|
||||
auto search = applicationMap.find(processName);
|
||||
|
||||
Reference in New Issue
Block a user