Add AIL product enablers

Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
Kamil Diedrich
2021-08-09 08:38:18 +00:00
committed by Compute-Runtime-Automation
parent 0a106c150e
commit be598fc692
16 changed files with 200 additions and 45 deletions

View File

@ -7,8 +7,7 @@
set(NEO_CORE_AIL
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/ail_configuration.h
${CMAKE_CURRENT_SOURCE_DIR}/ail_configuration.inl
${CMAKE_CURRENT_SOURCE_DIR}/ail_configuration.cpp
${CMAKE_CURRENT_SOURCE_DIR}/${BRANCH_DIR_SUFFIX}/ail_configuration.cpp
)
set_property(GLOBAL PROPERTY NEO_CORE_AIL ${NEO_CORE_AIL})

View File

@ -12,7 +12,9 @@
#pragma once
namespace NEO {
enum class AILEnumeration : uint32_t {
DISABLE_COMPRESSION,
AIL_MAX_OPTIONS_COUNT
};

View File

@ -1,20 +0,0 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include <map>
#include <string_view>
namespace NEO {
extern std::map<std::string_view, std::vector<AILEnumeration>> applicationMapHW;
template <PRODUCT_FAMILY Product>
void AILConfigurationHw<Product>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
}
} // namespace NEO

View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include <map>
namespace NEO {
static EnableAIL<IGFX_ALDERLAKE_S> enableAILADLS;
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapADLS = {};
template <>
inline void AILConfigurationHw<IGFX_ALDERLAKE_S>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
}
} // namespace NEO

View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include <map>
namespace NEO {
static EnableAIL<IGFX_DG1> enableAILDG1;
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapDG1 = {};
template <>
inline void AILConfigurationHw<IGFX_DG1>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
}
} // namespace NEO

View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include <map>
namespace NEO {
static EnableAIL<IGFX_ROCKETLAKE> enableAILRKL;
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapRKL = {};
template <>
inline void AILConfigurationHw<IGFX_ROCKETLAKE>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
}
} // namespace NEO

View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include <map>
namespace NEO {
static EnableAIL<IGFX_TIGERLAKE_LP> enableAILTGLLP;
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapTGLLP = {};
template <>
inline void AILConfigurationHw<IGFX_TIGERLAKE_LP>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
}
} // namespace NEO

View File

@ -19,6 +19,20 @@ bool AILConfiguration::initProcessExecutableName() {
std::wcstombs(processFilename, processFilenameW, MAX_PATH);
}
std::string_view pathView(processFilename);
auto lastPosition = pathView.find_last_of("\\");
pathView.remove_prefix(lastPosition + 1u);
lastPosition = pathView.find(".exe");
if (lastPosition != std::string_view::npos) {
pathView.remove_suffix(pathView.size() - lastPosition);
}
processName = pathView;
return status;
}
} // namespace NEO

View File

@ -0,0 +1,19 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include <map>
namespace NEO {
static EnableAIL<IGFX_XE_HP_SDV> enableAILXEHPSDV;
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapXEHPSDV = {};
template <>
inline void AILConfigurationHw<IGFX_XE_HP_SDV>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
}
} // namespace NEO

View File

@ -60,6 +60,11 @@ macro(macro_for_each_platform)
endif()
endforeach()
set(SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/ail${BRANCH_DIR}${GEN_TYPE_LOWER}${BRANCH}${PLATFORM_IT_LOWER}/ail_configuration_${PLATFORM_IT_LOWER}.cpp)
if(EXISTS ${SRC_FILE})
list(APPEND ${GEN_TYPE}_SRC_LINK_BASE ${SRC_FILE})
endif()
set(SRC_FILE "${CORE_GENX_PREFIX}/os_agnostic_hw_info_config_${PLATFORM_IT_LOWER}.inl")
if(EXISTS ${SRC_FILE})
list(APPEND CORE_SRCS_${GEN_TYPE}_H_BASE ${SRC_FILE})

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2020 Intel Corporation
# Copyright (C) 2020-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@ -17,3 +17,5 @@ else()
endif()
set_property(GLOBAL PROPERTY SHARED_SRCS_ADDITIONAL_FILES_GEN12LP ${SHARED_SRCS_ADDITIONAL_FILES_GEN12LP})
add_subdirectories()

View File

@ -5,12 +5,9 @@
*
*/
#include "shared/source/ail/ail_configuration.h"
#include "shared/source/ail/ail_configuration.inl"
#include "shared/source/gen12lp/hw_cmds.h"
#include "shared/source/helpers/hw_helper.h"
#include <map>
namespace NEO {
extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
@ -25,22 +22,4 @@ struct EnableCoreGen12LP {
};
static EnableCoreGen12LP enable;
extern AILConfiguration *ailConfigurationTable[IGFX_MAX_PRODUCT];
#ifdef SUPPORT_DG1
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapDG1 = {};
template <>
void AILConfigurationHw<IGFX_DG1>::applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) {
}
static EnableAIL<IGFX_DG1> enableDG1;
#endif
#ifdef SUPPORT_TGLLP
std::map<std::string_view, std::vector<AILEnumeration>> applicationMapTGLLP = {};
static EnableAIL<IGFX_TIGERLAKE_LP> enableTgllp;
#endif
} // namespace NEO

View File

@ -64,6 +64,9 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE
hardwareInfo->platform.usDeviceID = static_cast<unsigned short>(std::stoi(DebugManager.flags.ForceDeviceId.get(), nullptr, 16));
}
[[maybe_unused]] bool result = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->initAilConfiguration();
DEBUG_BREAK_IF(!result);
auto csrType = DebugManager.flags.SetCommandStreamReceiver.get();
if (csrType > 0) {
auto &hwHelper = HwHelper::get(hardwareInfo->platform.eRenderCoreFamily);

View File

@ -18,6 +18,11 @@ macro(macro_for_each_platform)
list(APPEND igdrcl_libult_common_SRCS_ENABLE_TESTED_HW ${SRC_FILE})
endif()
endforeach()
set(SRC_FILE ${NEO_SHARED_DIRECTORY}/ail${BRANCH_DIR}${GEN_TYPE_LOWER}${BRANCH}${PLATFORM_IT_LOWER}/ail_configuration_${PLATFORM_IT_LOWER}.cpp)
if(EXISTS ${SRC_FILE})
list(APPEND igdrcl_libult_common_SRCS_ENABLE_TESTED_HW ${SRC_FILE})
endif()
endforeach()
endforeach()
endmacro()
@ -48,7 +53,7 @@ macro(macro_for_each_gen)
endforeach()
endforeach()
apply_macro_for_each_platform()
apply_macro_for_each_platform("TESTED")
endmacro()
apply_macro_for_each_gen("TESTED")

View File

@ -0,0 +1,18 @@
#
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
set(NEO_CORE_AIL_TESTS_WINDOWS
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/ail_windows_tests.cpp
)
set_property(GLOBAL PROPERTY NEO_CORE_AIL_TESTS_WINDOWS ${NEO_CORE_AIL_TESTS_WINDOWS})
if(WIN32)
target_sources(${TARGET_NAME} PRIVATE
${NEO_CORE_AIL_TESTS_WINDOWS}
)
endif()

View File

@ -0,0 +1,53 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "shared/test/common/helpers/variable_backup.h"
#include "test.h"
namespace NEO {
using AILTests = ::testing::Test;
namespace SysCalls {
extern const wchar_t *currentLibraryPath;
}
template <PRODUCT_FAMILY productFamily>
class AILMock : public AILConfigurationHw<productFamily> {
public:
using AILConfiguration::processName;
};
HWTEST2_F(AILTests, givenValidApplicationPathWhenAILinitProcessExecutableNameThenProperProcessNameIsReturned, IsAtLeastGen12lp) {
VariableBackup<const wchar_t *> applicationPathBackup(&SysCalls::currentLibraryPath);
applicationPathBackup = L"C\\Users\\Administrator\\application.exe";
VariableBackup<AILConfiguration *> ailConfigurationBackup(&ailConfigurationTable[productFamily]);
AILMock<productFamily> ailTemp;
ailConfigurationTable[productFamily] = &ailTemp;
EXPECT_EQ(ailTemp.initProcessExecutableName(), true);
EXPECT_EQ("application", ailTemp.processName);
}
HWTEST2_F(AILTests, givenValidApplicationPathWithoutLongNameWhenAILinitProcessExecutableNameThenProperProcessNameIsReturned, IsAtLeastGen12lp) {
VariableBackup<const wchar_t *> applicationPathBackup(&SysCalls::currentLibraryPath);
applicationPathBackup = L"C\\Users\\Administrator\\application";
VariableBackup<AILConfiguration *> ailConfigurationBackup(&ailConfigurationTable[productFamily]);
AILMock<productFamily> ailTemp;
ailConfigurationTable[productFamily] = &ailTemp;
EXPECT_EQ(ailTemp.initProcessExecutableName(), true);
EXPECT_EQ("application", ailTemp.processName);
}
} // namespace NEO