mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
Add compilerHwInfoConfig
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> Related-To: NEO-6237
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0f7378f64e
commit
cfc673b77c
@@ -1015,19 +1015,6 @@ HWTEST2_F(HwHelperTest, givenDefaultHwHelperHwWhenGettingIsBlitCopyRequiredForLo
|
||||
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(*defaultHwInfo, graphicsAllocation));
|
||||
}
|
||||
|
||||
HWTEST_F(HwHelperTest, whenIsMidThreadPreemptionSupportedIsCalledThenCorrectResultIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
const auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
|
||||
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = true;
|
||||
auto midThreadPreemptionSupported = hwHelper.isMidThreadPreemptionSupported(hwInfo);
|
||||
EXPECT_TRUE(midThreadPreemptionSupported);
|
||||
|
||||
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = false;
|
||||
midThreadPreemptionSupported = hwHelper.isMidThreadPreemptionSupported(hwInfo);
|
||||
EXPECT_FALSE(midThreadPreemptionSupported);
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, WhenIsFusedEuDispatchEnabledIsCalledThenFalseIsReturned) {
|
||||
if (hardwareInfo.platform.eRenderCoreFamily == IGFX_GEN12LP_CORE) {
|
||||
GTEST_SKIP();
|
||||
|
||||
@@ -31,7 +31,6 @@ class MockOfflineCompiler : public OfflineCompiler {
|
||||
using OfflineCompiler::internalOptions;
|
||||
using OfflineCompiler::irBinary;
|
||||
using OfflineCompiler::irBinarySize;
|
||||
using OfflineCompiler::isMidThreadPreemptionSupported;
|
||||
using OfflineCompiler::isSpirV;
|
||||
using OfflineCompiler::options;
|
||||
using OfflineCompiler::outputDirectory;
|
||||
|
||||
@@ -1036,20 +1036,6 @@ TEST(OfflineCompilerTest, givenDefaultOfflineCompilerObjectWhenNoOptionsAreChang
|
||||
EXPECT_FALSE(mockOfflineCompiler->inputFileSpirV);
|
||||
}
|
||||
|
||||
TEST(OfflineCompilerTest, whenIsMidThreadPreemptionSupportedIsCalledThenCorrectResultIsReturned) {
|
||||
MockOfflineCompiler offlineCompiler;
|
||||
|
||||
if (!hardwarePrefix[IGFX_SKYLAKE]) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
offlineCompiler.getHardwareInfo("skl");
|
||||
offlineCompiler.hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = false;
|
||||
EXPECT_FALSE(offlineCompiler.isMidThreadPreemptionSupported(offlineCompiler.hwInfo));
|
||||
|
||||
offlineCompiler.hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = true;
|
||||
EXPECT_TRUE(offlineCompiler.isMidThreadPreemptionSupported(offlineCompiler.hwInfo));
|
||||
}
|
||||
|
||||
TEST(OfflineCompilerTest, givenIntermediateRepresentationInputWhenBuildSourceCodeIsCalledThenProperTranslationContextIsUsed) {
|
||||
MockOfflineCompiler mockOfflineCompiler;
|
||||
std::vector<std::string> argv = {
|
||||
|
||||
@@ -27,6 +27,9 @@ set(CLOC_LIB_SRCS_LIB
|
||||
${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}devices_additional.inl
|
||||
${NEO_SHARED_DIRECTORY}/dll/devices/devices_base.inl
|
||||
${NEO_SHARED_DIRECTORY}/helpers/abort.cpp
|
||||
${NEO_SHARED_DIRECTORY}/helpers/compiler_hw_info_config.h
|
||||
${NEO_SHARED_DIRECTORY}/helpers/compiler_hw_info_config.cpp
|
||||
${NEO_SHARED_DIRECTORY}/helpers/compiler_hw_info_config_bdw_and_later.inl
|
||||
${NEO_SHARED_DIRECTORY}/helpers/compiler_options_parser.cpp
|
||||
${NEO_SHARED_DIRECTORY}/helpers/compiler_options_parser.h
|
||||
${NEO_SHARED_DIRECTORY}/helpers/debug_helpers.cpp
|
||||
|
||||
@@ -17,8 +17,4 @@ void OfflineCompiler::resolveExtraSettings() {
|
||||
}
|
||||
}
|
||||
|
||||
bool OfflineCompiler::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) {
|
||||
return hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "shared/source/device_binary_format/device_binary_formats.h"
|
||||
#include "shared/source/device_binary_format/elf/elf_encoder.h"
|
||||
#include "shared/source/device_binary_format/elf/ocl_elf.h"
|
||||
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||
#include "shared/source/helpers/compiler_options_parser.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/helpers/file_io.h"
|
||||
@@ -609,7 +610,10 @@ int OfflineCompiler::initialize(size_t numArgs, const std::vector<std::string> &
|
||||
igcFeWa.get()->SetFtrGTX(hwInfo.featureTable.ftrGTX);
|
||||
igcFeWa.get()->SetFtr5Slice(hwInfo.featureTable.ftr5Slice);
|
||||
|
||||
igcFeWa.get()->SetFtrGpGpuMidThreadLevelPreempt(isMidThreadPreemptionSupported(hwInfo));
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
if (compilerHwInfoConfig) {
|
||||
igcFeWa.get()->SetFtrGpGpuMidThreadLevelPreempt(compilerHwInfoConfig->isMidThreadPreemptionSupported(hwInfo));
|
||||
}
|
||||
igcFeWa.get()->SetFtrIoMmuPageFaulting(hwInfo.featureTable.ftrIoMmuPageFaulting);
|
||||
igcFeWa.get()->SetFtrWddm2Svm(hwInfo.featureTable.ftrWddm2Svm);
|
||||
igcFeWa.get()->SetFtrPooledEuEnabled(hwInfo.featureTable.ftrPooledEuEnabled);
|
||||
|
||||
@@ -96,7 +96,6 @@ class OfflineCompiler {
|
||||
int parseCommandLine(size_t numArgs, const std::vector<std::string> &allArgs);
|
||||
void setStatelessToStatefullBufferOffsetFlag();
|
||||
void resolveExtraSettings();
|
||||
bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo);
|
||||
void parseDebugSettings();
|
||||
void storeBinary(char *&pDst, size_t &dstSize, const void *pSrc, const size_t srcSize);
|
||||
MOCKABLE_VIRTUAL int buildSourceCode();
|
||||
|
||||
@@ -13,7 +13,6 @@ set(NEO_CORE_COMPILER_INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_interface.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/create_main.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/default_cache_config.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}compiler_extra_settings.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/intermediate_representations.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linker.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linker.inl
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/compiler_interface/compiler_interface.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
bool CompilerInterface::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) {
|
||||
return hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/compiler_interface/compiler_interface.inl"
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/os_interface/os_inc_base.h"
|
||||
|
||||
@@ -452,7 +453,7 @@ IGC::IgcOclDeviceCtxTagOCL *CompilerInterface::getIgcDeviceCtx(const Device &dev
|
||||
igcFeWa.get()->SetFtrGTX(device.getHardwareInfo().featureTable.ftrGTX);
|
||||
igcFeWa.get()->SetFtr5Slice(device.getHardwareInfo().featureTable.ftr5Slice);
|
||||
|
||||
igcFeWa.get()->SetFtrGpGpuMidThreadLevelPreempt(isMidThreadPreemptionSupported(device.getHardwareInfo()));
|
||||
igcFeWa.get()->SetFtrGpGpuMidThreadLevelPreempt(CompilerHwInfoConfig::get(hwInfo->platform.eProductFamily)->isMidThreadPreemptionSupported(*hwInfo));
|
||||
igcFeWa.get()->SetFtrIoMmuPageFaulting(device.getHardwareInfo().featureTable.ftrIoMmuPageFaulting);
|
||||
igcFeWa.get()->SetFtrWddm2Svm(device.getHardwareInfo().featureTable.ftrWddm2Svm);
|
||||
igcFeWa.get()->SetFtrPooledEuEnabled(device.getHardwareInfo().featureTable.ftrPooledEuEnabled);
|
||||
|
||||
@@ -183,7 +183,5 @@ class CompilerInterface {
|
||||
bool requiresIgc = (IGC::CodeType::oclC != translationSrc) || ((IGC::CodeType::spirV != translationDst) && (IGC::CodeType::llvmBc != translationDst) && (IGC::CodeType::llvmLl != translationDst));
|
||||
return (isFclAvailable() || (false == requiresFcl)) && (isIgcAvailable() || (false == requiresIgc));
|
||||
}
|
||||
|
||||
bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo);
|
||||
};
|
||||
} // namespace NEO
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/gen11/hw_cmds.h"
|
||||
#include "shared/source/helpers/compiler_hw_info_config_bdw_and_later.inl"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
#include "opencl/source/helpers/enable_product.inl"
|
||||
@@ -14,12 +15,15 @@ namespace NEO {
|
||||
|
||||
#ifdef SUPPORT_ICLLP
|
||||
static EnableGfxProductHw<IGFX_ICELAKE_LP> enableGfxProductHwICLLP;
|
||||
static EnableCompilerHwInfoConfig<IGFX_ICELAKE_LP> enableCompilerHwInfoConfigICLLP;
|
||||
#endif
|
||||
#ifdef SUPPORT_LKF
|
||||
static EnableGfxProductHw<IGFX_LAKEFIELD> enableGfxProductHwLKF;
|
||||
static EnableCompilerHwInfoConfig<IGFX_LAKEFIELD> enableCompilerHwInfoConfigLKF;
|
||||
#endif
|
||||
#ifdef SUPPORT_EHL
|
||||
static EnableGfxProductHw<IGFX_ELKHARTLAKE> enableGfxProductHwEHL;
|
||||
static EnableCompilerHwInfoConfig<IGFX_ELKHARTLAKE> enableCompilerHwInfoConfigEHL;
|
||||
#endif
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/gen12lp/hw_cmds.h"
|
||||
#include "shared/source/helpers/compiler_hw_info_config_bdw_and_later.inl"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
#include "opencl/source/helpers/enable_product.inl"
|
||||
@@ -14,17 +15,22 @@ namespace NEO {
|
||||
|
||||
#ifdef SUPPORT_TGLLP
|
||||
static EnableGfxProductHw<IGFX_TIGERLAKE_LP> enableGfxProductHwTGLLP;
|
||||
static EnableCompilerHwInfoConfig<IGFX_TIGERLAKE_LP> enableCompilerHwInfoConfigTGLLP;
|
||||
#endif
|
||||
#ifdef SUPPORT_DG1
|
||||
static EnableGfxProductHw<IGFX_DG1> enableGfxProductHwDG1;
|
||||
static EnableCompilerHwInfoConfig<IGFX_DG1> enableCompilerHwInfoConfigDG1;
|
||||
#endif
|
||||
#ifdef SUPPORT_RKL
|
||||
static EnableGfxProductHw<IGFX_ROCKETLAKE> enableGfxProductHwRKL;
|
||||
static EnableCompilerHwInfoConfig<IGFX_ROCKETLAKE> enableCompilerHwInfoConfigRKL;
|
||||
#endif
|
||||
#ifdef SUPPORT_ADLS
|
||||
static EnableGfxProductHw<IGFX_ALDERLAKE_S> enableGfxProductHwADLS;
|
||||
static EnableCompilerHwInfoConfig<IGFX_ALDERLAKE_S> enableCompilerHwInfoConfigADLS;
|
||||
#endif
|
||||
#ifdef SUPPORT_ADLP
|
||||
static EnableGfxProductHw<IGFX_ALDERLAKE_P> enableGfxProductHwADLP;
|
||||
static EnableCompilerHwInfoConfig<IGFX_ALDERLAKE_P> enableCompilerHwInfoConfigADLP;
|
||||
#endif
|
||||
} // namespace NEO
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/gen8/hw_cmds.h"
|
||||
#include "shared/source/helpers/compiler_hw_info_config_bdw_and_later.inl"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
#include "opencl/source/helpers/enable_product.inl"
|
||||
@@ -14,6 +15,7 @@ namespace NEO {
|
||||
|
||||
#ifdef SUPPORT_BDW
|
||||
static EnableGfxProductHw<IGFX_BROADWELL> enableGfxProductHwBDW;
|
||||
static EnableCompilerHwInfoConfig<IGFX_BROADWELL> enableCompilerHwInfoConfigBDW;
|
||||
#endif
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gen9/hw_cmds.h"
|
||||
#include "shared/source/helpers/compiler_hw_info_config_bdw_and_later.inl"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
#include "opencl/source/helpers/enable_product.inl"
|
||||
@@ -14,18 +15,23 @@ namespace NEO {
|
||||
|
||||
#ifdef SUPPORT_BXT
|
||||
static EnableGfxProductHw<IGFX_BROXTON> enableGfxProductHwBXT;
|
||||
static EnableCompilerHwInfoConfig<IGFX_BROXTON> enableCompilerHwInfoConfigBXT;
|
||||
#endif
|
||||
#ifdef SUPPORT_CFL
|
||||
static EnableGfxProductHw<IGFX_COFFEELAKE> enableGfxProductHwCFL;
|
||||
static EnableCompilerHwInfoConfig<IGFX_COFFEELAKE> enableCompilerHwInfoConfigCFL;
|
||||
#endif
|
||||
#ifdef SUPPORT_GLK
|
||||
static EnableGfxProductHw<IGFX_GEMINILAKE> enableGfxProductHwGLK;
|
||||
static EnableCompilerHwInfoConfig<IGFX_GEMINILAKE> enableCompilerHwInfoConfigGLK;
|
||||
#endif
|
||||
#ifdef SUPPORT_KBL
|
||||
static EnableGfxProductHw<IGFX_KABYLAKE> enableGfxProductHwKBL;
|
||||
static EnableCompilerHwInfoConfig<IGFX_KABYLAKE> enableCompilerHwInfoConfigKBL;
|
||||
#endif
|
||||
#ifdef SUPPORT_SKL
|
||||
static EnableGfxProductHw<IGFX_SKYLAKE> enableGfxProductHwSKL;
|
||||
static EnableCompilerHwInfoConfig<IGFX_SKYLAKE> enableCompilerHwInfoConfigSKL;
|
||||
#endif
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -27,6 +27,9 @@ set(NEO_CORE_HELPERS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cache_policy.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cache_policy.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/common_types.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_hw_info_config.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_hw_info_config.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_hw_info_config_bdw_and_later.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_options_parser.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_options_parser.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/completion_stamp.cpp
|
||||
|
||||
14
shared/source/helpers/compiler_hw_info_config.cpp
Normal file
14
shared/source/helpers/compiler_hw_info_config.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
CompilerHwInfoConfig *CompilerHwInfoConfigFactory[IGFX_MAX_PRODUCT] = {};
|
||||
|
||||
} // namespace NEO
|
||||
53
shared/source/helpers/compiler_hw_info_config.h
Normal file
53
shared/source/helpers/compiler_hw_info_config.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
#include "igfxfmid.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
class CompilerHwInfoConfig;
|
||||
struct HardwareInfo;
|
||||
extern CompilerHwInfoConfig *CompilerHwInfoConfigFactory[IGFX_MAX_PRODUCT];
|
||||
|
||||
class CompilerHwInfoConfig {
|
||||
public:
|
||||
static CompilerHwInfoConfig *get(PRODUCT_FAMILY product) {
|
||||
return CompilerHwInfoConfigFactory[product];
|
||||
}
|
||||
|
||||
virtual bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const = 0;
|
||||
};
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
class CompilerHwInfoConfigHw : public CompilerHwInfoConfig {
|
||||
public:
|
||||
static CompilerHwInfoConfig *get() {
|
||||
static CompilerHwInfoConfigHw<gfxProduct> instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
protected:
|
||||
CompilerHwInfoConfigHw() = default;
|
||||
};
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
struct EnableCompilerHwInfoConfig {
|
||||
typedef typename HwMapper<gfxProduct>::GfxProduct GfxProduct;
|
||||
|
||||
EnableCompilerHwInfoConfig() {
|
||||
CompilerHwInfoConfig *pCompilerHwInfoConfig = CompilerHwInfoConfigHw<gfxProduct>::get();
|
||||
CompilerHwInfoConfigFactory[gfxProduct] = pCompilerHwInfoConfig;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
namespace NEO {
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool CompilerHwInfoConfigHw<gfxProduct>::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const {
|
||||
return hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -127,7 +127,6 @@ class HwHelper {
|
||||
virtual uint32_t getPlanarYuvMaxHeight() const = 0;
|
||||
virtual bool isBlitterForImagesSupported(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual size_t getPreemptionAllocationAlignment() const = 0;
|
||||
virtual bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual std::unique_ptr<TagAllocatorBase> createTimestampPacketAllocator(const std::vector<uint32_t> &rootDeviceIndices, MemoryManager *memoryManager,
|
||||
size_t initialTagCount, CommandStreamReceiverType csrType,
|
||||
DeviceBitfield deviceBitfield) const = 0;
|
||||
@@ -360,8 +359,6 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
bool additionalPipeControlArgsRequired() const override;
|
||||
|
||||
bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
bool isEngineTypeRemappingToHwSpecificRequired() const override;
|
||||
|
||||
bool isSipKernelAsHexadecimalArrayPreferred() const override;
|
||||
|
||||
@@ -608,11 +608,6 @@ bool HwHelperHw<GfxFamily>::isEngineTypeRemappingToHwSpecificRequired() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool HwHelperHw<GfxFamily>::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const {
|
||||
return static_cast<bool>(hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool HwHelperHw<GfxFamily>::isSipKernelAsHexadecimalArrayPreferred() const {
|
||||
return false;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
@@ -175,8 +176,9 @@ int HwInfoConfig::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo
|
||||
drm->checkNonPersistentContextsSupport();
|
||||
drm->checkPreemptionSupport();
|
||||
bool preemption = drm->isPreemptionSupported();
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(outHwInfo->platform.eProductFamily);
|
||||
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
|
||||
hwHelper.isMidThreadPreemptionSupported(*outHwInfo) && preemption,
|
||||
compilerHwInfoConfig->isMidThreadPreemptionSupported(*outHwInfo) && preemption,
|
||||
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt) && preemption,
|
||||
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt) && preemption);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
@@ -19,7 +20,7 @@ namespace NEO {
|
||||
int HwInfoConfig::configureHwInfoWddm(const HardwareInfo *inHwInfo, HardwareInfo *outHwInfo, OSInterface *osIface) {
|
||||
auto &hwHelper = HwHelper::get(outHwInfo->platform.eRenderCoreFamily);
|
||||
auto &hwInfoConfig = *HwInfoConfig::get(outHwInfo->platform.eProductFamily);
|
||||
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(outHwInfo->platform.eProductFamily);
|
||||
outHwInfo->capabilityTable.ftrSvm = outHwInfo->featureTable.ftrSVM;
|
||||
|
||||
hwHelper.adjustDefaultEngineType(outHwInfo);
|
||||
@@ -29,7 +30,7 @@ int HwInfoConfig::configureHwInfoWddm(const HardwareInfo *inHwInfo, HardwareInfo
|
||||
outHwInfo->capabilityTable.ftrSupportsCoherency &= inHwInfo->featureTable.ftrL3IACoherency;
|
||||
|
||||
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
|
||||
hwHelper.isMidThreadPreemptionSupported(*outHwInfo),
|
||||
compilerHwInfoConfig->isMidThreadPreemptionSupported(*outHwInfo),
|
||||
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt),
|
||||
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt));
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/compiler_hw_info_config_bdw_and_later.inl"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
@@ -14,5 +15,6 @@ namespace NEO {
|
||||
|
||||
#ifdef SUPPORT_XE_HP_SDV
|
||||
static EnableGfxProductHw<IGFX_XE_HP_SDV> enableGfxProductHwXEHP;
|
||||
static EnableCompilerHwInfoConfig<IGFX_XE_HP_SDV> enableCompilerHwInfoConfigXEHP;
|
||||
#endif
|
||||
} // namespace NEO
|
||||
|
||||
@@ -25,7 +25,6 @@ class MockCompilerInterface : public CompilerInterface {
|
||||
using CompilerInterface::isCompilerAvailable;
|
||||
using CompilerInterface::isFclAvailable;
|
||||
using CompilerInterface::isIgcAvailable;
|
||||
using CompilerInterface::isMidThreadPreemptionSupported;
|
||||
|
||||
using CompilerInterface::fclMain;
|
||||
using CompilerInterface::igcMain;
|
||||
|
||||
@@ -1163,16 +1163,6 @@ TEST_F(CompilerInterfaceTest, GivenRequestForNewFclTranslationCtxWhenInterfaceVe
|
||||
setFclDebugVars(prevDebugVars);
|
||||
}
|
||||
|
||||
HWTEST_F(CompilerInterfaceTest, whenIsMidThreadPreemptionSupportedIsCalledThenCorrectResultIsReturned) {
|
||||
auto device = this->pDevice;
|
||||
auto &hwInfo = *device->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
UnitTestHelper<FamilyType>::setExtraMidThreadPreemptionFlag(hwInfo, false);
|
||||
EXPECT_FALSE(pCompilerInterface->isMidThreadPreemptionSupported(hwInfo));
|
||||
|
||||
UnitTestHelper<FamilyType>::setExtraMidThreadPreemptionFlag(hwInfo, true);
|
||||
EXPECT_TRUE(pCompilerInterface->isMidThreadPreemptionSupported(hwInfo));
|
||||
}
|
||||
|
||||
struct SpecConstantsTranslationCtxMock {
|
||||
bool returnFalse = false;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ set(IGDRCL_SRCS_tests_helpers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/array_count_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/basic_math_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bit_helpers_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_hw_info_config_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/debug_helpers_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter_helpers_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dirty_state_helpers_tests.cpp
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using CompilerHwInfoConfigFixture = Test<DeviceFixture>;
|
||||
|
||||
HWTEST_F(CompilerHwInfoConfigFixture, WhenIsMidThreadPreemptionIsSupportedIsCalledThenCorrectResultIsReturned) {
|
||||
auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
UnitTestHelper<FamilyType>::setExtraMidThreadPreemptionFlag(hwInfo, false);
|
||||
auto compilerHwInfoConfig = CompilerHwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
EXPECT_FALSE(compilerHwInfoConfig->isMidThreadPreemptionSupported(hwInfo));
|
||||
UnitTestHelper<FamilyType>::setExtraMidThreadPreemptionFlag(hwInfo, true);
|
||||
EXPECT_TRUE(compilerHwInfoConfig->isMidThreadPreemptionSupported(hwInfo));
|
||||
}
|
||||
Reference in New Issue
Block a user