mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Add AIL for Davinci Resolve
This AIL allows the Davinci Resolve to use overlapping buffers outside of the specification Related-To: NEO-5871 Signed-off-by: Andrzej Koska andrzej.koska@intel.com
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
c22be9427d
commit
f1a38cbe49
@ -8,7 +8,9 @@
|
||||
#include "shared/source/ail/ail_configuration.h"
|
||||
|
||||
#include "shared/source/helpers/hash.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
@ -21,4 +23,5 @@ bool AILConfiguration::isKernelHashCorrect(const std::string &kernelsSources, ui
|
||||
bool AILConfiguration::sourcesContainKernel(const std::string &kernelsSources, std::string_view kernelName) const {
|
||||
return (kernelsSources.find(kernelName) != std::string::npos);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
@ -33,6 +33,7 @@ enum class AILEnumeration : uint32_t {
|
||||
DISABLE_BLITTER,
|
||||
DISABLE_COMPRESSION,
|
||||
ENABLE_FP64,
|
||||
DISABLE_HOST_PTR_TRACKING,
|
||||
AIL_MAX_OPTIONS_COUNT
|
||||
};
|
||||
|
||||
|
38
shared/source/ail/gen11/ehl/ail_configuration_ehl.cpp
Normal file
38
shared/source/ail/gen11/ehl/ail_configuration_ehl.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/ail/ail_configuration_base.inl"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
static EnableAIL<IGFX_ELKHARTLAKE> enableAILEHL;
|
||||
|
||||
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapEHL = {
|
||||
{"resolve", {AILEnumeration::DISABLE_HOST_PTR_TRACKING}} // Disable hostPtrTracking for DaVinci Resolve
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void AILConfigurationHw<IGFX_ELKHARTLAKE>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
|
||||
auto search = applicationMapEHL.find(processName);
|
||||
if (search != applicationMapEHL.end()) {
|
||||
for (size_t i = 0; i < search->second.size(); ++i) {
|
||||
switch (search->second[i]) {
|
||||
case AILEnumeration::DISABLE_HOST_PTR_TRACKING:
|
||||
runtimeCapabilityTable.hostPtrTrackingEnabled = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template class AILConfigurationHw<IGFX_ELKHARTLAKE>;
|
||||
} // namespace NEO
|
38
shared/source/ail/gen11/icllp/ail_configuration_icllp.cpp
Normal file
38
shared/source/ail/gen11/icllp/ail_configuration_icllp.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/ail/ail_configuration_base.inl"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
static EnableAIL<IGFX_ICELAKE_LP> enableAILICLLP;
|
||||
|
||||
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapICLLP = {
|
||||
{"resolve", {AILEnumeration::DISABLE_HOST_PTR_TRACKING}} // Disable hostPtrTracking for DaVinci Resolve
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void AILConfigurationHw<IGFX_ICELAKE_LP>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
|
||||
auto search = applicationMapICLLP.find(processName);
|
||||
if (search != applicationMapICLLP.end()) {
|
||||
for (size_t i = 0; i < search->second.size(); ++i) {
|
||||
switch (search->second[i]) {
|
||||
case AILEnumeration::DISABLE_HOST_PTR_TRACKING:
|
||||
runtimeCapabilityTable.hostPtrTrackingEnabled = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template class AILConfigurationHw<IGFX_ICELAKE_LP>;
|
||||
} // namespace NEO
|
38
shared/source/ail/gen11/lkf/ail_configuration_lkf.cpp
Normal file
38
shared/source/ail/gen11/lkf/ail_configuration_lkf.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/ail/ail_configuration_base.inl"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
static EnableAIL<IGFX_LAKEFIELD> enableAILLKF;
|
||||
|
||||
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapLKF = {
|
||||
{"resolve", {AILEnumeration::DISABLE_HOST_PTR_TRACKING}} // Disable hostPtrTracking for DaVinci Resolve
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void AILConfigurationHw<IGFX_LAKEFIELD>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
|
||||
auto search = applicationMapLKF.find(processName);
|
||||
if (search != applicationMapLKF.end()) {
|
||||
for (size_t i = 0; i < search->second.size(); ++i) {
|
||||
switch (search->second[i]) {
|
||||
case AILEnumeration::DISABLE_HOST_PTR_TRACKING:
|
||||
runtimeCapabilityTable.hostPtrTrackingEnabled = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template class AILConfigurationHw<IGFX_LAKEFIELD>;
|
||||
} // namespace NEO
|
38
shared/source/ail/gen9/bxt/ail_configuration_bxt.cpp
Normal file
38
shared/source/ail/gen9/bxt/ail_configuration_bxt.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/ail/ail_configuration_base.inl"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
static EnableAIL<IGFX_BROXTON> enableAILBXT;
|
||||
|
||||
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapBXT = {
|
||||
{"resolve", {AILEnumeration::DISABLE_HOST_PTR_TRACKING}} // Disable hostPtrTracking for DaVinci Resolve
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void AILConfigurationHw<IGFX_BROXTON>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
|
||||
auto search = applicationMapBXT.find(processName);
|
||||
if (search != applicationMapBXT.end()) {
|
||||
for (size_t i = 0; i < search->second.size(); ++i) {
|
||||
switch (search->second[i]) {
|
||||
case AILEnumeration::DISABLE_HOST_PTR_TRACKING:
|
||||
runtimeCapabilityTable.hostPtrTrackingEnabled = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template class AILConfigurationHw<IGFX_BROXTON>;
|
||||
} // namespace NEO
|
38
shared/source/ail/gen9/cfl/ail_configuration_cfl.cpp
Normal file
38
shared/source/ail/gen9/cfl/ail_configuration_cfl.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/ail/ail_configuration_base.inl"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
static EnableAIL<IGFX_COFFEELAKE> enableAILCFL;
|
||||
|
||||
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapCFL = {
|
||||
{"resolve", {AILEnumeration::DISABLE_HOST_PTR_TRACKING}} // Disable hostPtrTracking for DaVinci Resolve
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void AILConfigurationHw<IGFX_COFFEELAKE>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
|
||||
auto search = applicationMapCFL.find(processName);
|
||||
if (search != applicationMapCFL.end()) {
|
||||
for (size_t i = 0; i < search->second.size(); ++i) {
|
||||
switch (search->second[i]) {
|
||||
case AILEnumeration::DISABLE_HOST_PTR_TRACKING:
|
||||
runtimeCapabilityTable.hostPtrTrackingEnabled = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template class AILConfigurationHw<IGFX_COFFEELAKE>;
|
||||
} // namespace NEO
|
38
shared/source/ail/gen9/glk/ail_configuration_glk.cpp
Normal file
38
shared/source/ail/gen9/glk/ail_configuration_glk.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/ail/ail_configuration_base.inl"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
static EnableAIL<IGFX_GEMINILAKE> enableAILGLK;
|
||||
|
||||
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapGLK = {
|
||||
{"resolve", {AILEnumeration::DISABLE_HOST_PTR_TRACKING}} // Disable hostPtrTracking for DaVinci Resolve
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void AILConfigurationHw<IGFX_GEMINILAKE>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
|
||||
auto search = applicationMapGLK.find(processName);
|
||||
if (search != applicationMapGLK.end()) {
|
||||
for (size_t i = 0; i < search->second.size(); ++i) {
|
||||
switch (search->second[i]) {
|
||||
case AILEnumeration::DISABLE_HOST_PTR_TRACKING:
|
||||
runtimeCapabilityTable.hostPtrTrackingEnabled = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template class AILConfigurationHw<IGFX_GEMINILAKE>;
|
||||
} // namespace NEO
|
38
shared/source/ail/gen9/kbl/ail_configuration_kbl.cpp
Normal file
38
shared/source/ail/gen9/kbl/ail_configuration_kbl.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/ail/ail_configuration_base.inl"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
static EnableAIL<IGFX_KABYLAKE> enableAILKBL;
|
||||
|
||||
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapKBL = {
|
||||
{"resolve", {AILEnumeration::DISABLE_HOST_PTR_TRACKING}} // Disable hostPtrTracking for DaVinci Resolve
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void AILConfigurationHw<IGFX_KABYLAKE>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
|
||||
auto search = applicationMapKBL.find(processName);
|
||||
if (search != applicationMapKBL.end()) {
|
||||
for (size_t i = 0; i < search->second.size(); ++i) {
|
||||
switch (search->second[i]) {
|
||||
case AILEnumeration::DISABLE_HOST_PTR_TRACKING:
|
||||
runtimeCapabilityTable.hostPtrTrackingEnabled = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template class AILConfigurationHw<IGFX_KABYLAKE>;
|
||||
} // namespace NEO
|
38
shared/source/ail/gen9/skl/ail_configuration_skl.cpp
Normal file
38
shared/source/ail/gen9/skl/ail_configuration_skl.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/ail/ail_configuration_base.inl"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace NEO {
|
||||
static EnableAIL<IGFX_SKYLAKE> enableAILSKL;
|
||||
|
||||
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapSKL = {
|
||||
{"resolve", {AILEnumeration::DISABLE_HOST_PTR_TRACKING}} // Disable hostPtrTracking for DaVinci Resolve
|
||||
};
|
||||
|
||||
template <>
|
||||
inline void AILConfigurationHw<IGFX_SKYLAKE>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
|
||||
auto search = applicationMapSKL.find(processName);
|
||||
if (search != applicationMapSKL.end()) {
|
||||
for (size_t i = 0; i < search->second.size(); ++i) {
|
||||
switch (search->second[i]) {
|
||||
case AILEnumeration::DISABLE_HOST_PTR_TRACKING:
|
||||
runtimeCapabilityTable.hostPtrTrackingEnabled = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template class AILConfigurationHw<IGFX_SKYLAKE>;
|
||||
} // namespace NEO
|
@ -13,6 +13,7 @@
|
||||
namespace NEO {
|
||||
using IsSKL = IsProduct<IGFX_SKYLAKE>;
|
||||
using IsDG2 = IsProduct<IGFX_DG2>;
|
||||
using IsHostPtrTrackingDisabled = IsWithinGfxCore<IGFX_GEN9_CORE, IGFX_GEN11LP_CORE>;
|
||||
|
||||
using AILTests = ::testing::Test;
|
||||
template <PRODUCT_FAMILY productFamily>
|
||||
@ -23,10 +24,9 @@ class AILMock : public AILConfigurationHw<productFamily> {
|
||||
using AILConfiguration::sourcesContainKernel;
|
||||
};
|
||||
|
||||
HWTEST2_F(AILTests, givenUninitializedTemplateWhenGetAILConfigurationThenNullptrIsReturned, IsSKL) {
|
||||
HWTEST2_F(AILTests, givenInitializedTemplateWhenGetAILConfigurationThenNullptrIsNotReturned, IsSKL) {
|
||||
auto ailConfiguration = AILConfiguration::get(productFamily);
|
||||
|
||||
ASSERT_EQ(nullptr, ailConfiguration);
|
||||
EXPECT_NE(nullptr, ailConfiguration);
|
||||
}
|
||||
|
||||
HWTEST2_F(AILTests, givenInitilizedTemplateWhenApplyWithBlenderIsCalledThenFP64SupportIsEnabled, IsAtLeastGen12lp) {
|
||||
@ -179,4 +179,40 @@ HWTEST2_F(AILTests, whenModifyKernelIfRequiredIsCalledThenDontChangeKernelSource
|
||||
EXPECT_STREQ(copyKernel.c_str(), kernelSources.c_str());
|
||||
}
|
||||
|
||||
HWTEST2_F(AILTests, givenPreGen12AndProcessNameIsResolveWhenApplyWithDavinciResolveThenHostPtrTrackingIsDisabled, IsHostPtrTrackingDisabled) {
|
||||
VariableBackup<AILConfiguration *> ailConfigurationBackup(&ailConfigurationTable[productFamily]);
|
||||
|
||||
AILMock<productFamily> ailTemp;
|
||||
ailTemp.processName = "resolve";
|
||||
ailConfigurationTable[productFamily] = &ailTemp;
|
||||
|
||||
auto ailConfiguration = AILConfiguration::get(productFamily);
|
||||
ASSERT_NE(nullptr, ailConfiguration);
|
||||
|
||||
NEO::RuntimeCapabilityTable rtTable = {};
|
||||
rtTable.hostPtrTrackingEnabled = true;
|
||||
|
||||
ailConfiguration->apply(rtTable);
|
||||
|
||||
EXPECT_FALSE(rtTable.hostPtrTrackingEnabled);
|
||||
}
|
||||
|
||||
HWTEST2_F(AILTests, givenPreGen12AndAndProcessNameIsNotResolveWhenApplyWithDavinciResolveThenHostPtrTrackingIsEnabled, IsHostPtrTrackingDisabled) {
|
||||
VariableBackup<AILConfiguration *> ailConfigurationBackup(&ailConfigurationTable[productFamily]);
|
||||
|
||||
AILMock<productFamily> ailTemp;
|
||||
ailTemp.processName = "usualProcessName";
|
||||
ailConfigurationTable[productFamily] = &ailTemp;
|
||||
|
||||
auto ailConfiguration = AILConfiguration::get(productFamily);
|
||||
ASSERT_NE(nullptr, ailConfiguration);
|
||||
|
||||
NEO::RuntimeCapabilityTable rtTable = {};
|
||||
rtTable.hostPtrTrackingEnabled = true;
|
||||
|
||||
ailConfiguration->apply(rtTable);
|
||||
|
||||
EXPECT_TRUE(rtTable.hostPtrTrackingEnabled);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
Reference in New Issue
Block a user