refactor: add ail context sync flag

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-10-14 11:32:40 +00:00
committed by Compute-Runtime-Automation
parent dae8c34f81
commit 0b7e6d90a3
9 changed files with 106 additions and 34 deletions

View File

@@ -10,6 +10,7 @@
#include "igfxfmid.h"
#include <cstdint>
#include <set>
#include <string>
/*
@@ -56,6 +57,8 @@ class AILConfiguration {
virtual bool isFallbackToPatchtokensRequired(const std::string &kernelSources) = 0;
virtual bool isContextSyncFlagRequired() = 0;
protected:
virtual void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) = 0;
std::string processName;
@@ -66,6 +69,8 @@ class AILConfiguration {
extern AILConfiguration *ailConfigurationTable[IGFX_MAX_PRODUCT];
extern const std::set<std::string_view> applicationsContextSyncFlag;
template <PRODUCT_FAMILY Product>
class AILConfigurationHw : public AILConfiguration {
public:
@@ -78,6 +83,7 @@ class AILConfigurationHw : public AILConfiguration {
void modifyKernelIfRequired(std::string &kernel) override;
bool isFallbackToPatchtokensRequired(const std::string &kernelSources) override;
bool isContextSyncFlagRequired() override;
};
template <PRODUCT_FAMILY product>

View File

@@ -40,4 +40,9 @@ template <PRODUCT_FAMILY Product>
inline void AILConfigurationHw<Product>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
}
template <PRODUCT_FAMILY Product>
inline bool AILConfigurationHw<Product>::isContextSyncFlagRequired() {
return false;
}
} // namespace NEO

View File

@@ -24,6 +24,8 @@ std::map<std::string_view, std::vector<AILEnumeration>> applicationMap = {{"blen
// Modify reported platform name to ensure older versions of Adobe Premiere Pro are able to recognize the GPU device
{"Adobe Premiere Pro", {AILEnumeration::ENABLE_LEGACY_PLATFORM_NAME}}};
const std::set<std::string_view> applicationsContextSyncFlag = {};
AILConfiguration *ailConfigurationTable[IGFX_MAX_PRODUCT] = {};
AILConfiguration *AILConfiguration::get(PRODUCT_FAMILY productFamily) {

View File

@@ -0,0 +1,15 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration_base.inl"
namespace NEO {
static EnableAIL<IGFX_BROADWELL> enableAILBDW;
template class AILConfigurationHw<IGFX_BROADWELL>;
} // namespace NEO

View File

@@ -33,6 +33,12 @@ void AILConfigurationHw<IGFX_METEORLAKE>::applyExt(RuntimeCapabilityTable &runti
}
}
template <>
bool AILConfigurationHw<IGFX_METEORLAKE>::isContextSyncFlagRequired() {
auto iterator = applicationsContextSyncFlag.find(processName);
return iterator != applicationsContextSyncFlag.end();
}
template class AILConfigurationHw<IGFX_METEORLAKE>;
} // namespace NEO