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
16
opencl/test/unit_test/gen9/bxt/CMakeLists.txt
Normal file
16
opencl/test/unit_test/gen9/bxt/CMakeLists.txt
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(TESTS_BXT)
|
||||
set(IGDRCL_SRCS_tests_gen9_bxt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_tests_bxt.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_bxt.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_bxt.cpp
|
||||
)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_bxt})
|
||||
add_subdirectories()
|
||||
endif()
|
24
opencl/test/unit_test/gen9/bxt/device_tests_bxt.cpp
Normal file
24
opencl/test/unit_test/gen9/bxt/device_tests_bxt.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
|
||||
#include "fixtures/device_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
typedef Test<DeviceFixture> DeviceTest;
|
||||
|
||||
BXTTEST_F(DeviceTest, getSupportedClVersion12Device) {
|
||||
auto version = pDevice->getSupportedClVersion();
|
||||
EXPECT_EQ(12u, version);
|
||||
}
|
||||
|
||||
BXTTEST_F(DeviceTest, givenBxtDeviceWhenAskedForProflingTimerResolutionThen52IsReturned) {
|
||||
auto resolution = pDevice->getProfilingTimerResolution();
|
||||
EXPECT_DOUBLE_EQ(52.083, resolution);
|
||||
}
|
14
opencl/test/unit_test/gen9/bxt/linux/CMakeLists.txt
Normal file
14
opencl/test/unit_test/gen9/bxt/linux/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_tests_gen9_bxt_linux
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests.cpp
|
||||
)
|
||||
if(UNIX)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_bxt_linux})
|
||||
add_subdirectory(dll)
|
||||
endif()
|
11
opencl/test/unit_test/gen9/bxt/linux/dll/CMakeLists.txt
Normal file
11
opencl/test/unit_test/gen9/bxt/linux/dll/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_linux_dll_tests_gen9_bxt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_id_tests.cpp
|
||||
)
|
||||
target_sources(igdrcl_linux_dll_tests PRIVATE ${IGDRCL_SRCS_linux_dll_tests_gen9_bxt})
|
43
opencl/test/unit_test/gen9/bxt/linux/dll/device_id_tests.cpp
Normal file
43
opencl/test/unit_test/gen9/bxt/linux/dll/device_id_tests.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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(BxtDeviceIdTest, supportedDeviceId) {
|
||||
std::array<DeviceDescriptor, 8> expectedDescriptors = {{
|
||||
{IBXT_A_DEVICE_F0_ID, &BXT_1x3x6::hwInfo, &BXT_1x3x6::setupHardwareInfo, GTTYPE_GTA},
|
||||
{IBXT_C_DEVICE_F0_ID, &BXT_1x3x6::hwInfo, &BXT_1x3x6::setupHardwareInfo, GTTYPE_GTA},
|
||||
{IBXT_GT_3x6_DEVICE_ID, &BXT_1x3x6::hwInfo, &BXT_1x3x6::setupHardwareInfo, GTTYPE_GTA},
|
||||
{IBXT_P_3x6_DEVICE_ID, &BXT_1x3x6::hwInfo, &BXT_1x3x6::setupHardwareInfo, GTTYPE_GTA},
|
||||
{IBXT_P_12EU_3x6_DEVICE_ID, &BXT_1x2x6::hwInfo, &BXT_1x2x6::setupHardwareInfo, GTTYPE_GTA},
|
||||
{IBXT_PRO_12EU_3x6_DEVICE_ID, &BXT_1x2x6::hwInfo, &BXT_1x2x6::setupHardwareInfo, GTTYPE_GTA},
|
||||
{IBXT_PRO_3x6_DEVICE_ID, &BXT_1x3x6::hwInfo, &BXT_1x3x6::setupHardwareInfo, GTTYPE_GTA},
|
||||
{IBXT_X_DEVICE_F0_ID, &BXT_1x3x6::hwInfo, &BXT_1x3x6::setupHardwareInfo, GTTYPE_GTA},
|
||||
}};
|
||||
|
||||
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++;
|
||||
}
|
||||
}
|
249
opencl/test/unit_test/gen9/bxt/linux/hw_info_config_tests.cpp
Normal file
249
opencl/test/unit_test/gen9/bxt/linux/hw_info_config_tests.cpp
Normal file
@ -0,0 +1,249 @@
|
||||
/*
|
||||
* Copyright (C) 2017-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;
|
||||
using namespace std;
|
||||
|
||||
struct HwInfoConfigTestLinuxBxt : HwInfoConfigTestLinux {
|
||||
void SetUp() override {
|
||||
HwInfoConfigTestLinux::SetUp();
|
||||
drm->StoredDeviceID = IBXT_P_3x6_DEVICE_ID;
|
||||
drm->setGtType(GTTYPE_GTA);
|
||||
drm->StoredEUVal = 18;
|
||||
drm->StoredHasPooledEU = 1;
|
||||
drm->StoredMinEUinPool = 3;
|
||||
}
|
||||
};
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, configureHwInfo) {
|
||||
drm->StoredDeviceRevID = 0;
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
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((unsigned int)drm->StoredHasPooledEU, outHwInfo.featureTable.ftrPooledEuEnabled);
|
||||
EXPECT_EQ((uint32_t)drm->StoredMinEUinPool, outHwInfo.gtSystemInfo.EuCountPerPoolMin);
|
||||
EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGttCacheInvalidation);
|
||||
EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType);
|
||||
|
||||
//constant sysInfo/ftr flags
|
||||
EXPECT_EQ(1u, outHwInfo.gtSystemInfo.VEBoxInfo.Instances.Bits.VEBox0Enabled);
|
||||
EXPECT_TRUE(outHwInfo.gtSystemInfo.VEBoxInfo.IsValid);
|
||||
|
||||
EXPECT_EQ(GTTYPE_GTA, outHwInfo.platform.eGTType);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT1);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT1_5);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT2);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT3);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT4);
|
||||
EXPECT_EQ(1u, outHwInfo.featureTable.ftrGTA);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGTC);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGTX);
|
||||
|
||||
drm->StoredDeviceID = IBXT_P_12EU_3x6_DEVICE_ID;
|
||||
drm->setGtType(GTTYPE_GTC); //IBXT_P_12EU_3x6_DEVICE_ID is GTA, but fot test sake make it GTC
|
||||
drm->StoredMinEUinPool = 6;
|
||||
drm->StoredDeviceRevID = 4;
|
||||
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((unsigned int)drm->StoredHasPooledEU, outHwInfo.featureTable.ftrPooledEuEnabled);
|
||||
EXPECT_EQ((uint32_t)drm->StoredMinEUinPool, outHwInfo.gtSystemInfo.EuCountPerPoolMin);
|
||||
EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax);
|
||||
EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType);
|
||||
|
||||
EXPECT_EQ(GTTYPE_GTC, outHwInfo.platform.eGTType);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT1);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT1_5);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT2);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT3);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT4);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGTA);
|
||||
EXPECT_EQ(1u, outHwInfo.featureTable.ftrGTC);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGTX);
|
||||
|
||||
drm->StoredDeviceID = IBXT_P_12EU_3x6_DEVICE_ID;
|
||||
drm->setGtType(GTTYPE_GTX); //IBXT_P_12EU_3x6_DEVICE_ID is GTA, but fot test sake make it GTX
|
||||
drm->StoredMinEUinPool = 9;
|
||||
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((unsigned int)drm->StoredHasPooledEU, outHwInfo.featureTable.ftrPooledEuEnabled);
|
||||
EXPECT_EQ((uint32_t)drm->StoredMinEUinPool, outHwInfo.gtSystemInfo.EuCountPerPoolMin);
|
||||
EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax);
|
||||
EXPECT_EQ(aub_stream::ENGINE_RCS, outHwInfo.capabilityTable.defaultEngineType);
|
||||
|
||||
EXPECT_EQ(GTTYPE_GTX, outHwInfo.platform.eGTType);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT1);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT1_5);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT2);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT3);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGT4);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGTA);
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrGTC);
|
||||
EXPECT_EQ(1u, outHwInfo.featureTable.ftrGTX);
|
||||
|
||||
auto &outKmdNotifyProperties = outHwInfo.capabilityTable.kmdNotifyProperties;
|
||||
EXPECT_TRUE(outKmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(50000, outKmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_TRUE(outKmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(5000, outKmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
EXPECT_TRUE(outKmdNotifyProperties.enableQuickKmdSleepForSporadicWaits);
|
||||
EXPECT_EQ(200000, outKmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, negativeUnknownDevId) {
|
||||
drm->StoredDeviceID = 0;
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-1, ret);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, negativeFailedIoctlDevId) {
|
||||
drm->StoredRetValForDeviceID = -2;
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-2, ret);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, negativeFailedIoctlDevRevId) {
|
||||
drm->StoredRetValForDeviceRevID = -3;
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-3, ret);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, negativeFailedIoctlEuCount) {
|
||||
drm->StoredRetValForEUVal = -4;
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-4, ret);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, negativeFailedIoctlSsCount) {
|
||||
drm->StoredRetValForSSVal = -5;
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(-5, ret);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, configureHwInfoFailingEnabledPool) {
|
||||
drm->StoredRetValForPooledEU = -1;
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrPooledEuEnabled);
|
||||
EXPECT_EQ(0u, outHwInfo.gtSystemInfo.EuCountPerPoolMin);
|
||||
EXPECT_EQ(0u, outHwInfo.gtSystemInfo.EuCountPerPoolMax);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, configureHwInfoDisabledEnabledPool) {
|
||||
drm->StoredHasPooledEU = 0;
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
|
||||
EXPECT_EQ(0u, outHwInfo.featureTable.ftrPooledEuEnabled);
|
||||
EXPECT_EQ(0u, outHwInfo.gtSystemInfo.EuCountPerPoolMin);
|
||||
EXPECT_EQ(0u, outHwInfo.gtSystemInfo.EuCountPerPoolMax);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, configureHwInfoFailingMinEuInPool) {
|
||||
drm->StoredRetValForMinEUinPool = -1;
|
||||
|
||||
drm->StoredSSVal = 3;
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
|
||||
EXPECT_EQ(1u, outHwInfo.featureTable.ftrPooledEuEnabled);
|
||||
EXPECT_EQ(9u, outHwInfo.gtSystemInfo.EuCountPerPoolMin);
|
||||
EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax);
|
||||
|
||||
drm->StoredSSVal = 2;
|
||||
ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
|
||||
EXPECT_EQ(1u, outHwInfo.featureTable.ftrPooledEuEnabled);
|
||||
EXPECT_EQ(3u, outHwInfo.gtSystemInfo.EuCountPerPoolMin);
|
||||
EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, configureHwInfoInvalidMinEuInPool) {
|
||||
drm->StoredMinEUinPool = 4;
|
||||
|
||||
drm->StoredSSVal = 3;
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
|
||||
EXPECT_EQ(1u, outHwInfo.featureTable.ftrPooledEuEnabled);
|
||||
EXPECT_EQ(9u, outHwInfo.gtSystemInfo.EuCountPerPoolMin);
|
||||
EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax);
|
||||
|
||||
drm->StoredSSVal = 2;
|
||||
ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
|
||||
EXPECT_EQ(1u, outHwInfo.featureTable.ftrPooledEuEnabled);
|
||||
EXPECT_EQ(3u, outHwInfo.gtSystemInfo.EuCountPerPoolMin);
|
||||
EXPECT_EQ((outHwInfo.gtSystemInfo.EUCount - outHwInfo.gtSystemInfo.EuCountPerPoolMin), outHwInfo.gtSystemInfo.EuCountPerPoolMax);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, configureHwInfoWaFlags) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
|
||||
drm->StoredDeviceRevID = 0;
|
||||
int ret = hwInfoConfig->configureHwInfo(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
}
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestLinuxBxt, whenCallAdjustPlatformThenDoNothing) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
outHwInfo = pInHwInfo;
|
||||
hwInfoConfig->adjustPlatformForProductFamily(&outHwInfo);
|
||||
|
||||
int ret = memcmp(&outHwInfo.platform, &pInHwInfo.platform, sizeof(PLATFORM));
|
||||
EXPECT_EQ(0, ret);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
class BxtHwInfoTests : public ::testing::Test {
|
||||
};
|
||||
typedef ::testing::Types<BXT_1x2x6, BXT_1x3x6> bxtTestTypes;
|
||||
TYPED_TEST_CASE(BxtHwInfoTests, bxtTestTypes);
|
||||
TYPED_TEST(BxtHwInfoTests, 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);
|
||||
}
|
75
opencl/test/unit_test/gen9/bxt/test_device_caps_bxt.cpp
Normal file
75
opencl/test/unit_test/gen9/bxt/test_device_caps_bxt.cpp
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
|
||||
#include "fixtures/device_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
typedef Test<DeviceFixture> BxtDeviceCaps;
|
||||
|
||||
BXTTEST_F(BxtDeviceCaps, reportsOcl12) {
|
||||
const auto &caps = pDevice->getDeviceInfo();
|
||||
EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion);
|
||||
EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion);
|
||||
}
|
||||
|
||||
BXTTEST_F(BxtDeviceCaps, BxtProfilingTimerResolution) {
|
||||
const auto &caps = pDevice->getDeviceInfo();
|
||||
EXPECT_EQ(52u, caps.outProfilingTimerResolution);
|
||||
}
|
||||
|
||||
BXTTEST_F(BxtDeviceCaps, BxtClVersionSupport) {
|
||||
const auto &caps = pDevice->getDeviceInfo();
|
||||
EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion);
|
||||
EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion);
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
if (is64bit) {
|
||||
EXPECT_TRUE(memoryManager->peekForce32BitAllocations());
|
||||
EXPECT_TRUE(caps.force32BitAddressess);
|
||||
} else {
|
||||
EXPECT_FALSE(memoryManager->peekForce32BitAllocations());
|
||||
EXPECT_FALSE(caps.force32BitAddressess);
|
||||
}
|
||||
}
|
||||
|
||||
BXTTEST_F(BxtDeviceCaps, BxtSvmCapabilities) {
|
||||
const auto &caps = pDevice->getDeviceInfo();
|
||||
EXPECT_EQ(0u, caps.svmCapabilities);
|
||||
}
|
||||
|
||||
BXTTEST_F(BxtDeviceCaps, GivenBXTWhenCheckftr64KBpagesThenFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
|
||||
}
|
||||
|
||||
BXTTEST_F(BxtDeviceCaps, givenBXTWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
||||
}
|
||||
|
||||
typedef Test<DeviceFixture> BxtUsDeviceIdTest;
|
||||
|
||||
BXTTEST_F(BxtUsDeviceIdTest, isSimulationCap) {
|
||||
unsigned short bxtSimulationIds[3] = {
|
||||
IBXT_A_DEVICE_F0_ID,
|
||||
IBXT_C_DEVICE_F0_ID,
|
||||
0, // default, non-simulation
|
||||
};
|
||||
NEO::MockDevice *mockDevice = nullptr;
|
||||
|
||||
for (auto id : bxtSimulationIds) {
|
||||
mockDevice = createWithUsDeviceId(id);
|
||||
ASSERT_NE(mockDevice, nullptr);
|
||||
|
||||
if (id == 0)
|
||||
EXPECT_FALSE(mockDevice->isSimulation());
|
||||
else
|
||||
EXPECT_TRUE(mockDevice->isSimulation());
|
||||
delete mockDevice;
|
||||
}
|
||||
}
|
90
opencl/test/unit_test/gen9/bxt/test_hw_info_config_bxt.cpp
Normal file
90
opencl/test/unit_test/gen9/bxt/test_hw_info_config_bxt.cpp
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(BxtHwInfoConfig, givenHwInfoErrorneousConfigString) {
|
||||
if (IGFX_BROXTON != 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 BxtHwInfo = ::testing::Test;
|
||||
|
||||
BXTTEST_F(BxtHwInfo, givenBoolWhenCallBxtHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) {
|
||||
uint64_t configs[] = {
|
||||
0x100020006,
|
||||
0x100030006};
|
||||
bool boolValue[]{
|
||||
true, false};
|
||||
HardwareInfo hwInfo;
|
||||
GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo;
|
||||
FeatureTable &featureTable = hwInfo.featureTable;
|
||||
WorkaroundTable &workaroundTable = hwInfo.workaroundTable;
|
||||
PLATFORM &platform = hwInfo.platform;
|
||||
|
||||
for (auto &config : configs) {
|
||||
for (auto setParamBool : boolValue) {
|
||||
|
||||
gtSystemInfo = {0};
|
||||
featureTable = {};
|
||||
workaroundTable = {};
|
||||
platform.usRevId = 9;
|
||||
hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config);
|
||||
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrGpGpuMidBatchPreempt);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrGpGpuThreadGroupLevelPreempt);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrL3IACoherency);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrVEBOX);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrULT);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrGpGpuMidThreadLevelPreempt);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftr3dMidBatchPreempt);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftr3dObjectLevelPreempt);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrPerCtxtPreemptionGranularityControl);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrLCIA);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrPPGTT);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrIA32eGfxPTEs);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrDisplayYTiling);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrTranslationTable);
|
||||
EXPECT_EQ(setParamBool, featureTable.ftrUserModeTranslationTable);
|
||||
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.ftrGttCacheInvalidation);
|
||||
|
||||
EXPECT_EQ(setParamBool, workaroundTable.waLLCCachingUnsupported);
|
||||
EXPECT_EQ(setParamBool, workaroundTable.waMsaa8xTileYDepthPitchAlignment);
|
||||
EXPECT_EQ(setParamBool, workaroundTable.waFbcLinearSurfaceStride);
|
||||
EXPECT_EQ(setParamBool, workaroundTable.wa4kAlignUVOffsetNV12LinearSurface);
|
||||
EXPECT_EQ(setParamBool, workaroundTable.waEnablePreemptionGranularityControlByUMD);
|
||||
EXPECT_EQ(setParamBool, workaroundTable.waSendMIFLUSHBeforeVFE);
|
||||
EXPECT_EQ(setParamBool, workaroundTable.waForcePcBbFullCfgRestore);
|
||||
EXPECT_EQ(setParamBool, workaroundTable.waReportPerfCountUseGlobalContextID);
|
||||
EXPECT_EQ(setParamBool, workaroundTable.waSamplerCacheFlushBetweenRedescribedSurfaceReads);
|
||||
|
||||
platform.usRevId = 1;
|
||||
featureTable = {};
|
||||
hardwareInfoSetup[productFamily](&hwInfo, true, config);
|
||||
|
||||
EXPECT_EQ(false, featureTable.ftrGttCacheInvalidation);
|
||||
}
|
||||
}
|
||||
}
|
15
opencl/test/unit_test/gen9/bxt/windows/CMakeLists.txt
Normal file
15
opencl/test/unit_test/gen9/bxt/windows/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_tests_gen9_bxt_windows
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_bxt_windows.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests_bxt.cpp
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen9_bxt_windows})
|
||||
endif()
|
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2018-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 namespace std;
|
||||
|
||||
using HwInfoConfigTestWindowsBxt = HwInfoConfigTestWindows;
|
||||
|
||||
BXTTEST_F(HwInfoConfigTestWindowsBxt, whenCallAdjustPlatformThenDoNothing) {
|
||||
EXPECT_EQ(IGFX_BROXTON, productFamily);
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
outHwInfo = pInHwInfo;
|
||||
hwInfoConfig->adjustPlatformForProductFamily(&outHwInfo);
|
||||
|
||||
int ret = memcmp(&outHwInfo.platform, &pInHwInfo.platform, sizeof(PLATFORM));
|
||||
EXPECT_EQ(0, ret);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
|
||||
#include "fixtures/device_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
typedef Test<DeviceFixture> BxtDeviceCapsWindows;
|
||||
|
||||
BXTTEST_F(BxtDeviceCapsWindows, givenHwInfoWhenAskedForKmdNotifyMechanismThenReturnCorrectValues) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits);
|
||||
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds);
|
||||
}
|
Reference in New Issue
Block a user