mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Reorganization directory structure [2/n]
Change-Id: I47962d17d755e80dcd9476e1ed75560f433f6115
This commit is contained in:

committed by
Jaroslaw Chodor

parent
d015d3633f
commit
e8852a68c4
15
opencl/test/unit_test/gen11/ehl/CMakeLists.txt
Normal file
15
opencl/test/unit_test/gen11/ehl/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
#
|
||||
# Copyright (C) 2019-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(TESTS_EHL)
|
||||
set(IGDRCL_SRCS_tests_gen11_ehl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_ehl.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_ehl.cpp
|
||||
)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen11_ehl})
|
||||
add_subdirectories()
|
||||
endif()
|
14
opencl/test/unit_test/gen11/ehl/linux/CMakeLists.txt
Normal file
14
opencl/test/unit_test/gen11/ehl/linux/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright (C) 2019-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_tests_gen11_ehl_linux
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests_ehl.cpp
|
||||
)
|
||||
if(UNIX)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen11_ehl_linux})
|
||||
add_subdirectory(dll)
|
||||
endif()
|
11
opencl/test/unit_test/gen11/ehl/linux/dll/CMakeLists.txt
Normal file
11
opencl/test/unit_test/gen11/ehl/linux/dll/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
#
|
||||
# Copyright (C) 2019-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_linux_dll_tests_gen11_ehl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_id_tests_ehl.cpp
|
||||
)
|
||||
target_sources(igdrcl_linux_dll_tests PRIVATE ${IGDRCL_SRCS_linux_dll_tests_gen11_ehl})
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/os_interface/linux/drm_neo.h"
|
||||
#include "test.h"
|
||||
|
||||
#include <array>
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(EhlDeviceIdTest, supportedDeviceId) {
|
||||
std::array<DeviceDescriptor, 7> expectedDescriptors = {{
|
||||
{IEHL_1x4x8_SUPERSKU_DEVICE_A0_ID, &EHL_1x4x8::hwInfo, &EHL_1x4x8::setupHardwareInfo, GTTYPE_GT1},
|
||||
{IEHL_1x2x4_DEVICE_A0_ID, &EHL_1x2x4::hwInfo, &EHL_1x2x4::setupHardwareInfo, GTTYPE_GT1},
|
||||
{IEHL_1x4x4_DEVICE_A0_ID, &EHL_1x4x4::hwInfo, &EHL_1x4x4::setupHardwareInfo, GTTYPE_GT1},
|
||||
{IEHL_1x4x8_DEVICE_A0_ID, &EHL_1x4x8::hwInfo, &EHL_1x4x8::setupHardwareInfo, GTTYPE_GT1},
|
||||
{IJSL_1x4x4_DEVICE_B0_ID, &EHL_1x4x4::hwInfo, &EHL_1x4x4::setupHardwareInfo, GTTYPE_GT1},
|
||||
{IJSL_1x4x6_DEVICE_B0_ID, &EHL_1x4x6::hwInfo, &EHL_1x4x6::setupHardwareInfo, GTTYPE_GT1},
|
||||
{IJSL_1x4x8_DEVICE_B0_ID, &EHL_1x4x8::hwInfo, &EHL_1x4x8::setupHardwareInfo, GTTYPE_GT1},
|
||||
}};
|
||||
|
||||
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,88 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "helpers/gtest_helpers.h"
|
||||
#include "os_interface/linux/hw_info_config_linux_tests.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct HwInfoConfigTestLinuxEhl : HwInfoConfigTestLinux {
|
||||
void SetUp() override {
|
||||
HwInfoConfigTestLinux::SetUp();
|
||||
|
||||
drm->StoredDeviceID = IEHL_1x4x8_SUPERSKU_DEVICE_A0_ID;
|
||||
drm->setGtType(GTTYPE_GT1);
|
||||
drm->StoredSSVal = 8;
|
||||
}
|
||||
};
|
||||
|
||||
EHLTEST_F(HwInfoConfigTestLinuxEhl, configureHwInfoEhl) {
|
||||
auto hwInfoConfig = HwInfoConfigHw<IGFX_ELKHARTLAKE>::get();
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_EQ((unsigned short)drm->StoredDeviceID, outHwInfo.platform.usDeviceID);
|
||||
EXPECT_EQ((unsigned short)drm->StoredDeviceRevID, outHwInfo.platform.usRevId);
|
||||
EXPECT_EQ((uint32_t)drm->StoredEUVal, outHwInfo.gtSystemInfo.EUCount);
|
||||
EXPECT_EQ((uint32_t)drm->StoredSSVal, outHwInfo.gtSystemInfo.SubSliceCount);
|
||||
EXPECT_EQ(1u, outHwInfo.gtSystemInfo.SliceCount);
|
||||
|
||||
EXPECT_EQ(GTTYPE_GT1, outHwInfo.platform.eGTType);
|
||||
EXPECT_TRUE(outHwInfo.featureTable.ftrGT1);
|
||||
EXPECT_FALSE(outHwInfo.featureTable.ftrGT1_5);
|
||||
EXPECT_FALSE(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);
|
||||
}
|
||||
|
||||
EHLTEST_F(HwInfoConfigTestLinuxEhl, negative) {
|
||||
auto hwInfoConfig = HwInfoConfigHw<IGFX_ELKHARTLAKE>::get();
|
||||
|
||||
drm->StoredRetValForDeviceID = -1;
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-1, ret);
|
||||
|
||||
drm->StoredRetValForDeviceID = 0;
|
||||
drm->StoredRetValForDeviceRevID = -1;
|
||||
ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-1, ret);
|
||||
|
||||
drm->StoredRetValForDeviceRevID = 0;
|
||||
drm->StoredRetValForEUVal = -1;
|
||||
ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-1, ret);
|
||||
|
||||
drm->StoredRetValForEUVal = 0;
|
||||
drm->StoredRetValForSSVal = -1;
|
||||
ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-1, ret);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
class EhlHwInfoTests : public ::testing::Test {};
|
||||
typedef ::testing::Types<EHL_1x4x8> ehlTestTypes;
|
||||
TYPED_TEST_CASE(EhlHwInfoTests, ehlTestTypes);
|
||||
TYPED_TEST(EhlHwInfoTests, gtSetupIsCorrect) {
|
||||
HardwareInfo hwInfo;
|
||||
DrmMock drm;
|
||||
GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo;
|
||||
DeviceDescriptor device = {0, &hwInfo, &TypeParam::setupHardwareInfo, GTTYPE_GT1};
|
||||
|
||||
int ret = drm.setupHardwareInfo(&device, false);
|
||||
|
||||
EXPECT_EQ(ret, 0);
|
||||
EXPECT_GT(gtSystemInfo.EUCount, 0u);
|
||||
EXPECT_GT(gtSystemInfo.ThreadCount, 0u);
|
||||
EXPECT_GT(gtSystemInfo.SliceCount, 0u);
|
||||
EXPECT_GT(gtSystemInfo.SubSliceCount, 0u);
|
||||
EXPECT_GT_VAL(gtSystemInfo.L3CacheSizeInKb, 0u);
|
||||
EXPECT_EQ(gtSystemInfo.CsrSizeInMb, 8u);
|
||||
EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated);
|
||||
}
|
36
opencl/test/unit_test/gen11/ehl/test_device_caps_ehl.cpp
Normal file
36
opencl/test/unit_test/gen11/ehl/test_device_caps_ehl.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
|
||||
#include "fixtures/device_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using EhlTest = Test<DeviceFixture>;
|
||||
|
||||
EHLTEST_F(EhlTest, givenDeviceIdWhenAskingForSimulationThenReturnValidValue) {
|
||||
unsigned short ehlSimulationIds[2] = {
|
||||
IEHL_1x4x8_SUPERSKU_DEVICE_A0_ID,
|
||||
0, // default, non-simulation
|
||||
};
|
||||
|
||||
for (auto id : ehlSimulationIds) {
|
||||
auto mockDevice = std::unique_ptr<MockDevice>(createWithUsDeviceId(id));
|
||||
EXPECT_NE(nullptr, mockDevice);
|
||||
|
||||
if (id == 0) {
|
||||
EXPECT_FALSE(mockDevice->isSimulation());
|
||||
} else {
|
||||
EXPECT_TRUE(mockDevice->isSimulation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EHLTEST_F(EhlTest, givenEhlWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
||||
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
|
||||
}
|
88
opencl/test/unit_test/gen11/ehl/test_hw_info_config_ehl.cpp
Normal file
88
opencl/test/unit_test/gen11/ehl/test_hw_info_config_ehl.cpp
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(EhlHwInfoConfig, givenHwInfoErrorneousConfigString) {
|
||||
if (IGFX_ELKHARTLAKE != productFamily) {
|
||||
return;
|
||||
}
|
||||
HardwareInfo hwInfo;
|
||||
GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo;
|
||||
|
||||
uint64_t config = 0xdeadbeef;
|
||||
gtSystemInfo = {0};
|
||||
EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config));
|
||||
EXPECT_EQ(0u, gtSystemInfo.SliceCount);
|
||||
EXPECT_EQ(0u, gtSystemInfo.SubSliceCount);
|
||||
EXPECT_EQ(0u, gtSystemInfo.EUCount);
|
||||
}
|
||||
|
||||
using EhlHwInfo = ::testing::Test;
|
||||
|
||||
EHLTEST_F(EhlHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisabled) {
|
||||
HardwareInfo hwInfo;
|
||||
|
||||
uint64_t config = 0x100040008;
|
||||
hardwareInfoSetup[productFamily](&hwInfo, false, config);
|
||||
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler);
|
||||
EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption);
|
||||
EXPECT_FALSE(hwInfo.capabilityTable.supportsVme);
|
||||
}
|
||||
|
||||
EHLTEST_F(EhlHwInfo, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
|
||||
bool boolValue[]{
|
||||
true, false};
|
||||
HardwareInfo hwInfo;
|
||||
GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo;
|
||||
FeatureTable &featureTable = hwInfo.featureTable;
|
||||
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
|
||||
|
||||
uint64_t configs[] = {
|
||||
0x100040008,
|
||||
0x100040006,
|
||||
0x100040004,
|
||||
0x100020004};
|
||||
|
||||
for (auto config : configs) {
|
||||
for (auto setParamBool : boolValue) {
|
||||
|
||||
gtSystemInfo = {0};
|
||||
featureTable = {};
|
||||
workaroundTable = {};
|
||||
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
|
||||
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrL3IACoherency);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrPPGTT);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrSVM);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrIA32eGfxPTEs);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrStandardMipTailFormat);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrDisplayYTiling);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrTranslationTable);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrUserModeTranslationTable);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrTileMappedResource);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrEnableGuC);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrFbc);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrFbc2AddressTranslation);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrFbcBlitterTracking);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrFbcCpuTracking);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrTileY);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrAstcHdr2D);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrAstcLdr2D);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftr3dMidBatchPreempt);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrGpGpuMidBatchPreempt);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrGpGpuMidThreadLevelPreempt);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrGpGpuThreadGroupLevelPreempt);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrPerCtxtPreemptionGranularityControl);
|
||||
|
||||
EXPECT_EQ(setParamBool, workaroundTable.wa4kAlignUVOffsetNV12LinearSurface);
|
||||
EXPECT_EQ(setParamBool, workaroundTable.waReportPerfCountUseGlobalContextID);
|
||||
}
|
||||
}
|
||||
}
|
13
opencl/test/unit_test/gen11/ehl/windows/CMakeLists.txt
Normal file
13
opencl/test/unit_test/gen11/ehl/windows/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
||||
#
|
||||
# Copyright (C) 2019-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_tests_gen11_ehl_windows
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests_ehl.cpp
|
||||
)
|
||||
if(WIN32)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen11_ehl_windows})
|
||||
endif()
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/os_interface/windows/os_interface.h"
|
||||
|
||||
#include "os_interface/windows/hw_info_config_win_tests.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using HwInfoConfigTestWindowsEhl = HwInfoConfigTestWindows;
|
||||
|
||||
EHLTEST_F(HwInfoConfigTestWindowsEhl, whenCallAdjustPlatformThenDoNothing) {
|
||||
EXPECT_EQ(IGFX_ELKHARTLAKE, productFamily);
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
hwInfoConfig->adjustPlatformForProductFamily(&outHwInfo);
|
||||
|
||||
int ret = memcmp(&outHwInfo.platform, &pInHwInfo.platform, sizeof(PLATFORM));
|
||||
EXPECT_EQ(0, ret);
|
||||
}
|
Reference in New Issue
Block a user