mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-10 05:49:51 +08:00
Add support for adlp in opensource
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
2cc11f2199
commit
5f491ed22b
@@ -46,6 +46,7 @@ set(RUNTIME_SRCS_DLL_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linux/options_linux.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linux/os_interface.cpp
|
||||
${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}/devices.inl
|
||||
${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}/devices_additional.inl
|
||||
${NEO_SHARED_DIRECTORY}/dll/devices/devices_base.inl
|
||||
${NEO_SHARED_DIRECTORY}/os_interface/linux/sys_calls_linux.cpp
|
||||
${NEO_SOURCE_DIR}/opencl/source/os_interface/linux/platform_teardown_linux.cpp
|
||||
|
||||
@@ -40,6 +40,11 @@ macro(macro_for_each_platform)
|
||||
string(TOLOWER ${PLATFORM_IT} PLATFORM_IT_LOWER)
|
||||
|
||||
foreach(BRANCH_DIR ${BRANCH_DIR_LIST})
|
||||
set(PLATFORM_FILE "hw_info_setup_${PLATFORM_IT_LOWER}.inl")
|
||||
set(SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR}${GEN_TYPE_LOWER}/definitions${BRANCH_DIR_SUFFIX}/${PLATFORM_FILE})
|
||||
if(EXISTS ${SRC_FILE})
|
||||
list(APPEND RUNTIME_SRCS_${GEN_TYPE}_CPP_BASE ${SRC_FILE})
|
||||
endif()
|
||||
foreach(BRANCH ${BRANCH_DIR_LIST})
|
||||
set(PLATFORM_FILE "hw_info_${PLATFORM_IT_LOWER}.cpp")
|
||||
set(SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR}${GEN_TYPE_LOWER}${BRANCH}${PLATFORM_FILE})
|
||||
|
||||
15
opencl/source/gen12lp/definitions/hw_info_setup_adlp.inl
Normal file
15
opencl/source/gen12lp/definitions/hw_info_setup_adlp.inl
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
const uint64_t ADLP::defaultHardwareInfoConfig = 0x0;
|
||||
const HardwareInfo ADLP::hwInfo = ADLP_CONFIG::hwInfo;
|
||||
|
||||
void setupADLPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) {
|
||||
ADLP_CONFIG::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable);
|
||||
}
|
||||
|
||||
void (*ADLP::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupADLPHardwareInfoImpl;
|
||||
154
opencl/source/gen12lp/hw_info_adlp.cpp
Normal file
154
opencl/source/gen12lp/hw_info_adlp.cpp
Normal file
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/aub_mem_dump/definitions/aub_services.h"
|
||||
#include "shared/source/gen12lp/hw_cmds.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
|
||||
#include "engine_node.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
const char *HwMapper<IGFX_ALDERLAKE_P>::abbreviation = "adlp";
|
||||
|
||||
bool isSimulationADLP(unsigned short deviceId) {
|
||||
return false;
|
||||
};
|
||||
|
||||
const PLATFORM ADLP::platform = {
|
||||
IGFX_ALDERLAKE_P,
|
||||
PCH_UNKNOWN,
|
||||
IGFX_GEN12LP_CORE,
|
||||
IGFX_GEN12LP_CORE,
|
||||
PLATFORM_NONE, // default init
|
||||
0, // usDeviceID
|
||||
0, // usRevId. 0 sets the stepping to A0
|
||||
0, // usDeviceID_PCH
|
||||
0, // usRevId_PCH
|
||||
GTTYPE_UNDEFINED};
|
||||
|
||||
const RuntimeCapabilityTable ADLP::capabilityTable{
|
||||
EngineDirectSubmissionInitVec{
|
||||
{aub_stream::ENGINE_RCS, {true, true}},
|
||||
{aub_stream::ENGINE_CCS, {true, true}}}, // directSubmissionEngines
|
||||
{0, 0, 0, false, false, false}, // kmdNotifyProperties
|
||||
MemoryConstants::max64BitAppAddress, // gpuAddressSpace
|
||||
83.333, // defaultProfilingTimerResolution
|
||||
MemoryConstants::pageSize, // requiredPreemptionSurfaceSize
|
||||
&isSimulationADLP, // isSimulation
|
||||
PreemptionMode::MidThread, // defaultPreemptionMode
|
||||
aub_stream::ENGINE_RCS, // defaultEngineType
|
||||
0, // maxRenderFrequency
|
||||
30, // clVersionSupport
|
||||
CmdServicesMemTraceVersion::DeviceValues::Adlp, // aubDeviceId
|
||||
1, // extraQuantityThreadsPerEU
|
||||
64, // slmSize
|
||||
sizeof(ADLP::GRF), // grfSize
|
||||
36u, // timestampValidBits
|
||||
32u, // kernelTimestampValidBits
|
||||
false, // blitterOperationsSupported
|
||||
true, // ftrSupportsInteger64BitAtomics
|
||||
false, // ftrSupportsFP64
|
||||
false, // ftrSupports64BitMath
|
||||
true, // ftrSvm
|
||||
false, // ftrSupportsCoherency
|
||||
false, // ftrSupportsVmeAvcTextureSampler
|
||||
false, // ftrSupportsVmeAvcPreemption
|
||||
false, // ftrRenderCompressedBuffers
|
||||
false, // ftrRenderCompressedImages
|
||||
true, // instrumentationEnabled
|
||||
true, // forceStatelessCompilationFor32Bit
|
||||
true, // ftr64KBpages
|
||||
"lp", // platformType
|
||||
"", // deviceName
|
||||
true, // sourceLevelDebuggerSupported
|
||||
false, // supportsVme
|
||||
false, // supportCacheFlushAfterWalker
|
||||
true, // supportsImages
|
||||
false, // supportsDeviceEnqueue
|
||||
false, // supportsPipes
|
||||
true, // supportsOcl21Features
|
||||
false, // supportsOnDemandPageFaults
|
||||
false, // supportsIndependentForwardProgress
|
||||
false, // hostPtrTrackingEnabled
|
||||
true, // levelZeroSupported
|
||||
true, // isIntegratedDevice
|
||||
true, // supportsMediaBlock
|
||||
true // fusedEuEnabled
|
||||
};
|
||||
|
||||
WorkaroundTable ADLP::workaroundTable = {};
|
||||
FeatureTable ADLP::featureTable = {};
|
||||
|
||||
void ADLP::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) {
|
||||
FeatureTable *featureTable = &hwInfo->featureTable;
|
||||
WorkaroundTable *workaroundTable = &hwInfo->workaroundTable;
|
||||
|
||||
featureTable->ftrL3IACoherency = true;
|
||||
featureTable->ftrPPGTT = true;
|
||||
featureTable->ftrSVM = true;
|
||||
featureTable->ftrIA32eGfxPTEs = true;
|
||||
featureTable->ftrStandardMipTailFormat = true;
|
||||
|
||||
featureTable->ftrTranslationTable = true;
|
||||
featureTable->ftrUserModeTranslationTable = true;
|
||||
featureTable->ftrTileMappedResource = true;
|
||||
featureTable->ftrEnableGuC = true;
|
||||
|
||||
featureTable->ftrFbc = true;
|
||||
featureTable->ftrFbc2AddressTranslation = true;
|
||||
featureTable->ftrFbcBlitterTracking = true;
|
||||
featureTable->ftrFbcCpuTracking = true;
|
||||
featureTable->ftrTileY = false;
|
||||
|
||||
featureTable->ftrAstcHdr2D = true;
|
||||
featureTable->ftrAstcLdr2D = true;
|
||||
|
||||
featureTable->ftr3dMidBatchPreempt = true;
|
||||
featureTable->ftrGpGpuMidBatchPreempt = true;
|
||||
featureTable->ftrGpGpuThreadGroupLevelPreempt = true;
|
||||
featureTable->ftrPerCtxtPreemptionGranularityControl = true;
|
||||
|
||||
workaroundTable->wa4kAlignUVOffsetNV12LinearSurface = true;
|
||||
workaroundTable->waEnablePreemptionGranularityControlByUMD = true;
|
||||
workaroundTable->waUntypedBufferCompression = true;
|
||||
};
|
||||
const HardwareInfo ADLP_CONFIG::hwInfo = {
|
||||
&ADLP::platform,
|
||||
&ADLP::featureTable,
|
||||
&ADLP::workaroundTable,
|
||||
&ADLP_CONFIG::gtSystemInfo,
|
||||
ADLP::capabilityTable,
|
||||
};
|
||||
|
||||
GT_SYSTEM_INFO ADLP_CONFIG::gtSystemInfo = {0};
|
||||
void ADLP_CONFIG::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) {
|
||||
GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo;
|
||||
gtSysInfo->CsrSizeInMb = 8;
|
||||
gtSysInfo->IsDynamicallyPopulated = false;
|
||||
|
||||
// non-zero values for unit tests
|
||||
if (gtSysInfo->SliceCount == 0) {
|
||||
gtSysInfo->SliceCount = 2;
|
||||
gtSysInfo->SubSliceCount = 8;
|
||||
gtSysInfo->EUCount = 40;
|
||||
gtSysInfo->MaxEuPerSubSlice = ADLP::maxEuPerSubslice;
|
||||
gtSysInfo->MaxSlicesSupported = ADLP::maxSlicesSupported;
|
||||
gtSysInfo->MaxSubSlicesSupported = ADLP::maxSubslicesSupported;
|
||||
|
||||
gtSysInfo->L3BankCount = 1;
|
||||
|
||||
gtSysInfo->CCSInfo.IsValid = true;
|
||||
gtSysInfo->CCSInfo.NumberOfCCSEnabled = 1;
|
||||
}
|
||||
|
||||
if (setupFeatureTableAndWorkaroundTable) {
|
||||
setupFeatureAndWorkaroundTable(hwInfo);
|
||||
}
|
||||
};
|
||||
#include "hw_info_setup_adlp.inl"
|
||||
} // namespace NEO
|
||||
@@ -163,5 +163,5 @@ void XE_HP_SDV_CONFIG::setupHardwareInfoMultiTile(HardwareInfo *hwInfo, bool set
|
||||
XE_HP_SDV::setupFeatureAndWorkaroundTable(hwInfo);
|
||||
}
|
||||
};
|
||||
#include "hw_info_config_xehp.inl"
|
||||
#include "hw_info_setup_xehp.inl"
|
||||
} // namespace NEO
|
||||
|
||||
26
opencl/test/unit_test/gen12lp/adlp/CMakeLists.txt
Normal file
26
opencl/test/unit_test/gen12lp/adlp/CMakeLists.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(TESTS_ADLP)
|
||||
set(IGDRCL_SRCS_tests_gen12lp_adlp_excludes
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/excludes_adlp.cpp
|
||||
)
|
||||
set_property(GLOBAL APPEND PROPERTY IGDRCL_SRCS_tests_excludes ${IGDRCL_SRCS_tests_gen12lp_adlp_excludes})
|
||||
|
||||
set(IGDRCL_SRCS_tests_gen12lp_adlp
|
||||
${IGDRCL_SRCS_tests_gen12lp_adlp_excludes}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_adlp.cpp
|
||||
)
|
||||
|
||||
get_property(NEO_CORE_TESTS_GEN12LP_ADLP GLOBAL PROPERTY NEO_CORE_TESTS_GEN12LP_ADLP)
|
||||
list(APPEND IGDRCL_SRCS_tests_gen12lp_adlp ${NEO_CORE_TESTS_GEN12LP_ADLP})
|
||||
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen12lp_adlp})
|
||||
add_subdirectories()
|
||||
neo_copy_test_files_with_revision(copy_test_files_adlp_0 adlp 0)
|
||||
add_dependencies(copy_test_files_per_product copy_test_files_adlp_0)
|
||||
endif()
|
||||
12
opencl/test/unit_test/gen12lp/adlp/excludes_adlp.cpp
Normal file
12
opencl/test/unit_test/gen12lp/adlp/excludes_adlp.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(BufferSetSurfaceTests, givenBufferSetSurfaceThatMemoryIsUnalignedToCachelineButReadOnlyThenL3CacheShouldBeStillOn, IGFX_ALDERLAKE_P)
|
||||
HWTEST_EXCLUDE_PRODUCT(BufferSetSurfaceTests, givenAlignedCacheableReadOnlyBufferThenChoseOclBufferPolicy, IGFX_ALDERLAKE_P);
|
||||
HWTEST_EXCLUDE_PRODUCT(DeviceFactoryTest, givenInvalidHwConfigStringWhenPrepareDeviceEnvironmentsForProductFamilyOverrideThenThrowsException, IGFX_ALDERLAKE_P);
|
||||
14
opencl/test/unit_test/gen12lp/adlp/linux/CMakeLists.txt
Normal file
14
opencl/test/unit_test/gen12lp/adlp/linux/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_tests_gen12_adlp_linux
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests_adlp.cpp
|
||||
)
|
||||
if(UNIX)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen12_adlp_linux})
|
||||
add_subdirectory(dll)
|
||||
endif()
|
||||
11
opencl/test/unit_test/gen12lp/adlp/linux/dll/CMakeLists.txt
Normal file
11
opencl/test/unit_test/gen12lp/adlp/linux/dll/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_linux_dll_tests_gen12_adlp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/device_id_tests_adlp.cpp
|
||||
)
|
||||
target_sources(igdrcl_linux_dll_tests PRIVATE ${IGDRCL_SRCS_linux_dll_tests_gen12_adlp})
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gen12lp/hw_cmds.h"
|
||||
#include "shared/source/os_interface/linux/drm_neo.h"
|
||||
|
||||
#include "test.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(AdlpDeviceIdTest, GivenSupportedDeviceIdThenDeviceDescriptorTableExists) {
|
||||
std::array<DeviceDescriptor, 18> expectedDescriptors = {{
|
||||
{0x46A0, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46B0, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46A1, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46A2, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46A3, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46A6, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46A8, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46AA, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x462A, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x4626, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x4628, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46B1, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46B2, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46B3, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46C0, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46C1, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46C2, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
{0x46C3, &ADLP_CONFIG::hwInfo, &ADLP_CONFIG::setupHardwareInfo, GTTYPE_GT2},
|
||||
}};
|
||||
|
||||
auto compareStructs = [](const DeviceDescriptor *first, const DeviceDescriptor *second) {
|
||||
return first->deviceId == second->deviceId && first->pHwInfo == second->pHwInfo &&
|
||||
first->setupHardwareInfo == second->setupHardwareInfo && first->eGtType == second->eGtType;
|
||||
};
|
||||
|
||||
size_t startIndex = 0;
|
||||
while (!compareStructs(&expectedDescriptors[0], &deviceDescriptorTable[startIndex]) &&
|
||||
deviceDescriptorTable[startIndex].deviceId != 0) {
|
||||
startIndex++;
|
||||
};
|
||||
EXPECT_NE(0u, deviceDescriptorTable[startIndex].deviceId);
|
||||
|
||||
for (auto &expected : expectedDescriptors) {
|
||||
EXPECT_TRUE(compareStructs(&expected, &deviceDescriptorTable[startIndex]));
|
||||
startIndex++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
|
||||
#include "opencl/test/unit_test/helpers/gtest_helpers.h"
|
||||
#include "opencl/test/unit_test/os_interface/linux/drm_mock.h"
|
||||
#include "opencl/test/unit_test/os_interface/linux/hw_info_config_linux_tests.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct HwInfoConfigTestLinuxAdlp : HwInfoConfigTestLinux {
|
||||
void SetUp() override {
|
||||
HwInfoConfigTestLinux::SetUp();
|
||||
|
||||
drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
|
||||
|
||||
drm->storedDeviceID = IGFX_ALDERLAKE_P;
|
||||
drm->setGtType(GTTYPE_GT2);
|
||||
}
|
||||
};
|
||||
|
||||
ADLPTEST_F(HwInfoConfigTestLinuxAdlp, WhenConfiguringHwInfoThenInfoIsSetCorrectly) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
int ret = hwInfoConfig->configureHwInfoDrm(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_EQ(static_cast<unsigned short>(drm->storedDeviceID), outHwInfo.platform.usDeviceID);
|
||||
EXPECT_EQ(static_cast<unsigned short>(drm->storedDeviceRevID), outHwInfo.platform.usRevId);
|
||||
EXPECT_EQ(static_cast<uint32_t>(drm->storedEUVal), outHwInfo.gtSystemInfo.EUCount);
|
||||
EXPECT_EQ(static_cast<uint32_t>(drm->storedSSVal), outHwInfo.gtSystemInfo.SubSliceCount);
|
||||
EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount);
|
||||
|
||||
EXPECT_EQ(GTTYPE_GT2, outHwInfo.platform.eGTType);
|
||||
EXPECT_FALSE(outHwInfo.featureTable.ftrGT1);
|
||||
EXPECT_FALSE(outHwInfo.featureTable.ftrGT1_5);
|
||||
EXPECT_TRUE(outHwInfo.featureTable.ftrGT2);
|
||||
EXPECT_FALSE(outHwInfo.featureTable.ftrGT3);
|
||||
EXPECT_FALSE(outHwInfo.featureTable.ftrGT4);
|
||||
EXPECT_FALSE(outHwInfo.featureTable.ftrGTA);
|
||||
EXPECT_FALSE(outHwInfo.featureTable.ftrGTC);
|
||||
EXPECT_FALSE(outHwInfo.featureTable.ftrGTX);
|
||||
EXPECT_FALSE(outHwInfo.featureTable.ftrTileY);
|
||||
}
|
||||
|
||||
ADLPTEST_F(HwInfoConfigTestLinuxAdlp, GivenInvalidDeviceIdWhenConfiguringHwInfoThenErrorIsReturned) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
|
||||
drm->storedRetValForDeviceID = -1;
|
||||
int ret = hwInfoConfig->configureHwInfoDrm(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-1, ret);
|
||||
|
||||
drm->storedRetValForDeviceID = 0;
|
||||
drm->storedRetValForDeviceRevID = -1;
|
||||
ret = hwInfoConfig->configureHwInfoDrm(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-1, ret);
|
||||
|
||||
drm->storedRetValForDeviceRevID = 0;
|
||||
drm->failRetTopology = true;
|
||||
drm->storedRetValForEUVal = -1;
|
||||
ret = hwInfoConfig->configureHwInfoDrm(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-1, ret);
|
||||
|
||||
drm->storedRetValForEUVal = 0;
|
||||
drm->storedRetValForSSVal = -1;
|
||||
ret = hwInfoConfig->configureHwInfoDrm(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-1, ret);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
using AdlpConfigHwInfoTests = ::testing::Test;
|
||||
using adlpConfigTestTypes = ::testing::Types<ADLP_CONFIG>;
|
||||
TYPED_TEST_CASE(AdlpConfigHwInfoTests, adlpConfigTestTypes);
|
||||
TYPED_TEST(AdlpConfigHwInfoTests, givenAdlpConfigWhenSetupHardwareInfoThenGtSystemInfoAndWaAndFtrTablesAreSetCorrect) {
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
|
||||
DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo;
|
||||
auto &featureTable = hwInfo.featureTable;
|
||||
auto &workaroundTable = hwInfo.workaroundTable;
|
||||
DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1};
|
||||
|
||||
int ret = drm.setupHardwareInfo(&device, false);
|
||||
|
||||
EXPECT_EQ(ret, 0);
|
||||
EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb);
|
||||
EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled);
|
||||
EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated);
|
||||
|
||||
EXPECT_FALSE(featureTable.ftrL3IACoherency);
|
||||
EXPECT_FALSE(featureTable.ftrPPGTT);
|
||||
EXPECT_FALSE(featureTable.ftrSVM);
|
||||
EXPECT_FALSE(featureTable.ftrIA32eGfxPTEs);
|
||||
EXPECT_FALSE(featureTable.ftrStandardMipTailFormat);
|
||||
EXPECT_FALSE(featureTable.ftrTranslationTable);
|
||||
EXPECT_FALSE(featureTable.ftrUserModeTranslationTable);
|
||||
EXPECT_FALSE(featureTable.ftrTileMappedResource);
|
||||
EXPECT_FALSE(featureTable.ftrEnableGuC);
|
||||
EXPECT_FALSE(featureTable.ftrFbc);
|
||||
EXPECT_FALSE(featureTable.ftrFbc2AddressTranslation);
|
||||
EXPECT_FALSE(featureTable.ftrFbcBlitterTracking);
|
||||
EXPECT_FALSE(featureTable.ftrFbcCpuTracking);
|
||||
EXPECT_FALSE(featureTable.ftrTileY);
|
||||
EXPECT_FALSE(featureTable.ftrAstcHdr2D);
|
||||
EXPECT_FALSE(featureTable.ftrAstcLdr2D);
|
||||
EXPECT_FALSE(featureTable.ftr3dMidBatchPreempt);
|
||||
EXPECT_FALSE(featureTable.ftrGpGpuMidBatchPreempt);
|
||||
EXPECT_FALSE(featureTable.ftrGpGpuThreadGroupLevelPreempt);
|
||||
EXPECT_FALSE(featureTable.ftrPerCtxtPreemptionGranularityControl);
|
||||
|
||||
EXPECT_FALSE(workaroundTable.wa4kAlignUVOffsetNV12LinearSurface);
|
||||
EXPECT_FALSE(workaroundTable.waEnablePreemptionGranularityControlByUMD);
|
||||
EXPECT_FALSE(workaroundTable.waUntypedBufferCompression);
|
||||
|
||||
ret = drm.setupHardwareInfo(&device, true);
|
||||
|
||||
EXPECT_EQ(ret, 0);
|
||||
EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb);
|
||||
EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled);
|
||||
EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated);
|
||||
|
||||
EXPECT_TRUE(featureTable.ftrL3IACoherency);
|
||||
EXPECT_TRUE(featureTable.ftrPPGTT);
|
||||
EXPECT_TRUE(featureTable.ftrSVM);
|
||||
EXPECT_TRUE(featureTable.ftrIA32eGfxPTEs);
|
||||
EXPECT_TRUE(featureTable.ftrStandardMipTailFormat);
|
||||
EXPECT_TRUE(featureTable.ftrTranslationTable);
|
||||
EXPECT_TRUE(featureTable.ftrUserModeTranslationTable);
|
||||
EXPECT_TRUE(featureTable.ftrTileMappedResource);
|
||||
EXPECT_TRUE(featureTable.ftrEnableGuC);
|
||||
EXPECT_TRUE(featureTable.ftrFbc);
|
||||
EXPECT_TRUE(featureTable.ftrFbc2AddressTranslation);
|
||||
EXPECT_TRUE(featureTable.ftrFbcBlitterTracking);
|
||||
EXPECT_TRUE(featureTable.ftrFbcCpuTracking);
|
||||
EXPECT_FALSE(featureTable.ftrTileY);
|
||||
EXPECT_TRUE(featureTable.ftrAstcHdr2D);
|
||||
EXPECT_TRUE(featureTable.ftrAstcLdr2D);
|
||||
EXPECT_TRUE(featureTable.ftr3dMidBatchPreempt);
|
||||
EXPECT_TRUE(featureTable.ftrGpGpuMidBatchPreempt);
|
||||
EXPECT_TRUE(featureTable.ftrGpGpuThreadGroupLevelPreempt);
|
||||
EXPECT_TRUE(featureTable.ftrPerCtxtPreemptionGranularityControl);
|
||||
|
||||
EXPECT_TRUE(workaroundTable.wa4kAlignUVOffsetNV12LinearSurface);
|
||||
EXPECT_TRUE(workaroundTable.waEnablePreemptionGranularityControlByUMD);
|
||||
EXPECT_TRUE(workaroundTable.waUntypedBufferCompression);
|
||||
}
|
||||
|
||||
TYPED_TEST(AdlpConfigHwInfoTests, givenSliceCountZeroWhenSetupHardwareInfoThenNotZeroValuesSetInGtSystemInfo) {
|
||||
HardwareInfo hwInfo = {};
|
||||
hwInfo.gtSystemInfo = {0};
|
||||
|
||||
TypeParam::setupHardwareInfo(&hwInfo, false);
|
||||
|
||||
EXPECT_NE(0u, hwInfo.gtSystemInfo.SliceCount);
|
||||
EXPECT_NE(0u, hwInfo.gtSystemInfo.SubSliceCount);
|
||||
EXPECT_NE(0u, hwInfo.gtSystemInfo.EUCount);
|
||||
EXPECT_NE(0u, hwInfo.gtSystemInfo.MaxEuPerSubSlice);
|
||||
EXPECT_NE(0u, hwInfo.gtSystemInfo.MaxSlicesSupported);
|
||||
EXPECT_NE(0u, hwInfo.gtSystemInfo.MaxSubSlicesSupported);
|
||||
EXPECT_NE(0u, hwInfo.gtSystemInfo.L3BankCount);
|
||||
EXPECT_TRUE(hwInfo.gtSystemInfo.CCSInfo.IsValid);
|
||||
EXPECT_NE(0u, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
|
||||
}
|
||||
40
opencl/test/unit_test/gen12lp/adlp/test_device_caps_adlp.cpp
Normal file
40
opencl/test/unit_test/gen12lp/adlp/test_device_caps_adlp.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using AdlpUsDeviceIdTest = Test<ClDeviceFixture>;
|
||||
|
||||
ADLPTEST_F(AdlpUsDeviceIdTest, GivenNonZeroIdThenIsSimulationIsTrue) {
|
||||
unsigned short simulationIds[] = {
|
||||
0, // default, non-simulation
|
||||
};
|
||||
|
||||
for (auto id : simulationIds) {
|
||||
auto mockDevice = std::unique_ptr<MockDevice>(createWithUsDeviceId(id));
|
||||
ASSERT_NE(mockDevice.get(), nullptr);
|
||||
|
||||
if (id == 0) {
|
||||
EXPECT_FALSE(mockDevice->isSimulation());
|
||||
} else {
|
||||
EXPECT_TRUE(mockDevice->isSimulation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ADLPTEST_F(AdlpUsDeviceIdTest, givenADLPWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
||||
}
|
||||
|
||||
ADLPTEST_F(AdlpUsDeviceIdTest, givenAdlpWhenRequestedVmeFlagsThenReturnFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsVme);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcTextureSampler);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsVmeAvcPreemption);
|
||||
}
|
||||
@@ -22,11 +22,7 @@ bool SpecialUltHelperGen12lp::additionalCoherencyCheck(PRODUCT_FAMILY productFam
|
||||
}
|
||||
|
||||
bool SpecialUltHelperGen12lp::shouldPerformimagePitchAlignment(PRODUCT_FAMILY productFamily) {
|
||||
if (productFamily == IGFX_ROCKETLAKE || productFamily == IGFX_ALDERLAKE_S) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return productFamily == PRODUCT_FAMILY::IGFX_TIGERLAKE_LP || productFamily == PRODUCT_FAMILY::IGFX_DG1;
|
||||
}
|
||||
|
||||
bool SpecialUltHelperGen12lp::shouldTestDefaultImplementationOfSetupHardwareCapabilities(PRODUCT_FAMILY productFamily) {
|
||||
@@ -34,11 +30,7 @@ bool SpecialUltHelperGen12lp::shouldTestDefaultImplementationOfSetupHardwareCapa
|
||||
}
|
||||
|
||||
bool SpecialUltHelperGen12lp::isPipeControlWArequired(PRODUCT_FAMILY productFamily) {
|
||||
if (productFamily == IGFX_ROCKETLAKE || productFamily == IGFX_ALDERLAKE_S) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return productFamily == IGFX_TIGERLAKE_LP || productFamily == IGFX_DG1;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -48,7 +48,7 @@ target_link_libraries(igdrcl_${target_name} ${NEO_STATICALLY_LINKED_LIBRARIES_MO
|
||||
set_property(TARGET igdrcl_${target_name} APPEND_STRING PROPERTY COMPILE_FLAGS ${ASAN_FLAGS})
|
||||
target_include_directories(igdrcl_${target_name} PRIVATE
|
||||
${NEO_SHARED_TEST_DIRECTORY}/common/test_macros/header${BRANCH_DIR_SUFFIX}
|
||||
${NEO_SOURCE_DIR}/opencl/source/dll/linux/devices${BRANCH_DIR_SUFFIX}
|
||||
${NEO_SHARED_DIRECTORY}/dll/linux/devices${BRANCH_DIR_SUFFIX}
|
||||
${NEO_SOURCE_DIR}/opencl/test/unit_test/gen_common${BRANCH_DIR_SUFFIX}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user