2019-01-10 15:36:57 +01:00
|
|
|
/*
|
2023-01-16 16:40:13 +00:00
|
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
2019-01-10 15:36:57 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2022-06-29 19:17:47 +00:00
|
|
|
#include "shared/source/gen11/hw_cmds.h"
|
2023-02-01 16:23:01 +00:00
|
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
2022-10-28 13:51:20 +00:00
|
|
|
#include "shared/test/common/fixtures/device_fixture.h"
|
2023-01-16 16:40:13 +00:00
|
|
|
#include "shared/test/common/mocks/mock_device.h"
|
2022-06-29 19:17:47 +00:00
|
|
|
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
|
|
|
|
#include "shared/test/common/test_macros/test.h"
|
2020-02-24 10:22:30 +01:00
|
|
|
|
2019-01-10 15:36:57 +01:00
|
|
|
using namespace NEO;
|
|
|
|
|
|
2022-10-28 13:51:20 +00:00
|
|
|
using Gen11DeviceCaps = Test<DeviceFixture>;
|
2019-01-10 15:36:57 +01:00
|
|
|
|
2020-10-26 14:57:52 +01:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, GivenDefaultWhenCheckingPreemptionModeThenMidThreadIsReturned) {
|
2019-01-10 15:36:57 +01:00
|
|
|
EXPECT_TRUE(PreemptionMode::MidThread == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-26 14:57:52 +01:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, WhenCheckingProfilingTimerResolutionThenCorrectResolutionIsReturned) {
|
2019-01-10 15:36:57 +01:00
|
|
|
const auto &caps = pDevice->getDeviceInfo();
|
|
|
|
|
EXPECT_EQ(83u, caps.outProfilingTimerResolution);
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-26 14:57:52 +01:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, GivenWhenGettingKmdNotifyPropertiesThenItIsDisabled) {
|
2019-01-10 15:36:57 +01:00
|
|
|
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);
|
2021-12-17 18:42:13 +00:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission);
|
|
|
|
|
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds);
|
2019-01-10 15:36:57 +01:00
|
|
|
}
|
|
|
|
|
|
2020-10-26 14:57:52 +01:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, WhenCheckingCompressionThenItIsDisabled) {
|
2019-01-10 15:36:57 +01:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedBuffers);
|
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedImages);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenHwInfoWhenRequestedComputeUnitsUsedForScratchThenReturnValidValue) {
|
|
|
|
|
const auto &hwInfo = pDevice->getHardwareInfo();
|
2022-12-08 12:22:35 +00:00
|
|
|
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
2019-05-08 16:00:24 +02:00
|
|
|
uint32_t expectedValue = hwInfo.gtSystemInfo.MaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice * 8;
|
2019-01-10 15:36:57 +01:00
|
|
|
|
2022-12-08 12:22:35 +00:00
|
|
|
EXPECT_EQ(expectedValue, gfxCoreHelper.getComputeUnitsUsedForScratch(pDevice->getRootDeviceEnvironment()));
|
2019-01-10 15:36:57 +01:00
|
|
|
EXPECT_EQ(expectedValue, pDevice->getDeviceInfo().computeUnitsUsedForScratch);
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-29 15:37:54 +02:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenHwInfoWhenRequestedMaxFrontEndThreadsThenReturnValidValue) {
|
|
|
|
|
const auto &hwInfo = pDevice->getHardwareInfo();
|
|
|
|
|
|
2022-12-08 12:22:35 +00:00
|
|
|
EXPECT_EQ(GfxCoreHelper::getMaxThreadsForVfe(hwInfo), pDevice->getDeviceInfo().maxFrontEndThreads);
|
2019-05-29 15:37:54 +02:00
|
|
|
}
|
|
|
|
|
|
2019-01-10 15:36:57 +01:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckSupportCacheFlushAfterWalkerThenFalse) {
|
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker);
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-16 09:06:37 +02:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckBlitterOperationsSupportThenReturnFalse) {
|
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.blitterOperationsSupported);
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-30 17:32:14 +02:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingImageSupportThenReturnTrue) {
|
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages);
|
|
|
|
|
}
|
2020-02-06 15:10:59 +01:00
|
|
|
|
2021-05-13 14:58:26 +00:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingMediaBlockSupportThenReturnTrue) {
|
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsMediaBlock);
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-30 09:51:56 +02:00
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingCoherencySupportThenReturnFalse) {
|
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsCoherency);
|
|
|
|
|
}
|
2023-03-06 17:07:06 +00:00
|
|
|
|
|
|
|
|
GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingFloatAtomicsSupportThenReturnFalse) {
|
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsFloatAtomics);
|
|
|
|
|
}
|