Fix DG1 tests fail

Related-To: NEO-5679

Signed-off-by: Konstanty Misiak <konstanty.misiak@intel.com>
This commit is contained in:
Konstanty Misiak 2021-04-16 12:24:00 +00:00 committed by Compute-Runtime-Automation
parent 2b12e9b42f
commit 62d52ba2e9
10 changed files with 24 additions and 126 deletions

View File

@ -129,12 +129,7 @@ HWTEST2_F(DeviceQueueGroupTest,
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS);
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS);
auto hwInfoConfig = NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
if (hwInfoConfig->isEvenContextCountRequired()) {
EXPECT_EQ(properties[i].numQueues, 2u);
} else {
EXPECT_EQ(properties[i].numQueues, 1u);
}
EXPECT_EQ(properties[i].numQueues, 1u);
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
} else if (i == static_cast<uint32_t>(NEO::EngineGroupType::Compute)) {
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE);
@ -178,12 +173,7 @@ HWTEST2_F(DeviceQueueGroupTest,
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS);
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS);
auto hwInfoConfig = NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
if (hwInfoConfig->isEvenContextCountRequired()) {
EXPECT_EQ(properties[i].numQueues, 2u);
} else {
EXPECT_EQ(properties[i].numQueues, 1u);
}
EXPECT_EQ(properties[i].numQueues, 1u);
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
} else if (i == static_cast<uint32_t>(NEO::EngineGroupType::Compute)) {
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE);

View File

@ -1,13 +0,0 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
set(IGDRCL_SRCS_tests_gen12_dg1_windows
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests_dg1.cpp
)
if(WIN32)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen12_dg1_windows})
endif()

View File

@ -1,21 +0,0 @@
/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/os_interface/windows/os_interface.h"
#include "opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.h"
using namespace NEO;
using HwInfoConfigTestWindowsDg1 = HwInfoConfigTestWindows;
DG1TEST_F(HwInfoConfigTestWindowsDg1, whenCheckIfEvenContextCountIsRequiredThenReturnTrue) {
EXPECT_EQ(IGFX_DG1, productFamily);
auto hwInfoConfig = HwInfoConfig::get(productFamily);
EXPECT_TRUE(hwInfoConfig->isEvenContextCountRequired());
}

View File

@ -135,18 +135,32 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetAndBcsInfoSetWhenGetGpgp
EXPECT_EQ(aub_stream::ENGINE_BCS, engines[3].first);
}
GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetAndCcsDefualtEngineWhenGetGpgpuEnginesThenReturnTwoRcsEnginesAndOneCcs) {
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.featureTable.ftrCCSNode = false;
hwInfo.featureTable.ftrBcsInfo = 0;
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
EXPECT_EQ(3u, device->engines.size());
auto &engines = HwHelperHw<FamilyType>::get().getGpgpuEngineInstances(hwInfo);
EXPECT_EQ(3u, engines.size());
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[0].first);
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[1].first);
EXPECT_EQ(aub_stream::ENGINE_CCS, engines[2].first);
}
GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetWhenGetGpgpuEnginesThenReturnThreeRcsEngines) {
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.featureTable.ftrCCSNode = false;
hwInfo.featureTable.ftrBcsInfo = 0;
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
const auto expectedEnginesCount = HwInfoConfig::get(hwInfo.platform.eProductFamily)->isEvenContextCountRequired() ? 4u : 3u;
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
EXPECT_EQ(expectedEnginesCount, device->engines.size());
EXPECT_EQ(3u, device->engines.size());
auto &engines = HwHelperHw<FamilyType>::get().getGpgpuEngineInstances(hwInfo);
EXPECT_EQ(expectedEnginesCount, engines.size());
EXPECT_EQ(3u, engines.size());
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[0].first);
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[1].first);
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[2].first);
@ -162,46 +176,6 @@ GEN12LPTEST_F(HwHelperTestGen12Lp,
EXPECT_EQ(internalCopyEngine, nullptr);
}
GEN12LPTEST_F(HwHelperTestGen12Lp, givenEvenContextCountRequiredWhenGetGpgpuEnginesIsCalledThenInsertAdditionalEngineAtTheEndIfNeeded) {
struct MockHwInfoConfig : HwInfoConfigHw<IGFX_UNKNOWN> {
MockHwInfoConfig() {}
bool evenContextCountRequired = false;
bool isEvenContextCountRequired() override {
return evenContextCountRequired;
}
};
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.featureTable.ftrCCSNode = false;
hwInfo.featureTable.ftrBcsInfo = 0;
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
MockHwInfoConfig hwInfoConfig;
VariableBackup<HwInfoConfig *> hwInfoConfigBackup{&hwInfoConfigFactory[hwInfo.platform.eProductFamily], &hwInfoConfig};
hwInfoConfig.evenContextCountRequired = false;
auto engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
EXPECT_EQ(3u, engines.size());
hwInfoConfig.evenContextCountRequired = true;
engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
EXPECT_EQ(4u, engines.size());
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[engines.size() - 1].first);
hwInfo.featureTable.ftrCCSNode = true;
engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
EXPECT_EQ(4u, engines.size());
hwInfo.featureTable.ftrCCSNode = true;
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
EXPECT_EQ(4u, engines.size());
hwInfo.featureTable.ftrCCSNode = false;
engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
EXPECT_EQ(4u, engines.size());
}
GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetWhenGetGpgpuEnginesThenReturnTwoRcsAndCcsEngines) {
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.featureTable.ftrCCSNode = true;
@ -220,16 +194,15 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetWhenGetGpgpuEnginesThenRetu
GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetFtrGpGpuMidThreadLevelPreemptSetWhenGetGpgpuEnginesThenReturn2RcsAndCcsEngines) {
HardwareInfo hwInfo = *defaultHwInfo;
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
hwInfo.featureTable.ftrCCSNode = true;
hwInfo.featureTable.ftrBcsInfo = 0;
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = true;
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
size_t retDeivices = 3u + hwInfoConfig->isEvenContextCountRequired();
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
EXPECT_EQ(retDeivices, device->engines.size());
EXPECT_EQ(3u, device->engines.size());
auto &engines = HwHelperHw<FamilyType>::get().getGpgpuEngineInstances(hwInfo);
EXPECT_EQ(retDeivices, engines.size());
EXPECT_EQ(3u, engines.size());
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[0].first);
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[1].first);
EXPECT_EQ(aub_stream::ENGINE_CCS, engines[2].first);
@ -258,17 +231,13 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetAndDefaultRcsWhenGetGpgpuEn
hwInfo.featureTable.ftrBcsInfo = 0;
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
const auto expectedEnginesCount = HwInfoConfig::get(hwInfo.platform.eProductFamily)->isEvenContextCountRequired() ? 4u : 3u;
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
EXPECT_EQ(expectedEnginesCount, device->engines.size());
EXPECT_EQ(3u, device->engines.size());
auto &engines = HwHelperHw<FamilyType>::get().getGpgpuEngineInstances(hwInfo);
EXPECT_EQ(expectedEnginesCount, engines.size());
EXPECT_EQ(3u, engines.size());
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[0].first);
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[1].first);
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[2].first);
if (expectedEnginesCount == 4) {
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[3].first);
}
}
GEN12LPTEST_F(HwHelperTestGen12Lp, givenTgllpWhenIsFusedEuDispatchEnabledIsCalledThenResultIsCorrect) {

View File

@ -83,11 +83,6 @@ cl_unified_shared_memory_capabilities_intel HwInfoConfigHw<IGFX_UNKNOWN>::getSha
return 0;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isEvenContextCountRequired() {
return false;
}
template <>
void HwInfoConfigHw<IGFX_UNKNOWN>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo){};

View File

@ -61,11 +61,6 @@ template <>
void HwInfoConfigHw<IGFX_UNKNOWN>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isEvenContextCountRequired() {
return false;
}
template <>
void HwInfoConfigHw<IGFX_UNKNOWN>::convertTimestampsFromOaToCsDomain(uint64_t &timestampData){};

View File

@ -196,11 +196,6 @@ const HwHelper::EngineInstancesContainer HwHelperHw<Family>::getGpgpuEngineInsta
engines.push_back({aub_stream::ENGINE_BCS, EngineUsage::Regular});
}
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
if (hwInfoConfig->isEvenContextCountRequired() && engines.size() & 1) {
engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::Regular});
}
return engines;
};

View File

@ -35,11 +35,6 @@ void HwInfoConfigHw<IGFX_DG1>::adjustPlatformForProductFamily(HardwareInfo *hwIn
Gen12LPCommonFunctions::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
}
template <>
bool HwInfoConfigHw<IGFX_DG1>::isEvenContextCountRequired() {
return true;
}
template class HwInfoConfigHw<IGFX_DG1>;
#endif
#ifdef SUPPORT_RKL

View File

@ -35,7 +35,6 @@ class HwInfoConfig {
virtual uint64_t getCrossDeviceSharedMemCapabilities() = 0;
virtual void getKernelExtendedProperties(uint32_t *fp16, uint32_t *fp32, uint32_t *fp64) = 0;
virtual uint64_t getSharedSystemMemCapabilities() = 0;
virtual bool isEvenContextCountRequired() = 0;
virtual void convertTimestampsFromOaToCsDomain(uint64_t &timestampData) = 0;
virtual uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) = 0;
uint32_t threadsPerEu;
@ -57,7 +56,6 @@ class HwInfoConfigHw : public HwInfoConfig {
uint64_t getCrossDeviceSharedMemCapabilities() override;
void getKernelExtendedProperties(uint32_t *fp16, uint32_t *fp32, uint32_t *fp64) override;
uint64_t getSharedSystemMemCapabilities() override;
bool isEvenContextCountRequired() override;
void convertTimestampsFromOaToCsDomain(uint64_t &timestampData) override;
uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) override;

View File

@ -31,11 +31,6 @@ uint64_t HwInfoConfigHw<gfxProduct>::getSharedSystemMemCapabilities() {
return 0;
}
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isEvenContextCountRequired() {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
void HwInfoConfigHw<gfxProduct>::convertTimestampsFromOaToCsDomain(uint64_t &timestampData){};