2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2023-01-17 00:40:13 +08:00
|
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-06-30 03:17:47 +08:00
|
|
|
#include "shared/source/gen8/hw_cmds.h"
|
2023-02-02 00:23:01 +08:00
|
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
2021-12-23 17:28:36 +08:00
|
|
|
#include "shared/test/common/fixtures/device_fixture.h"
|
2023-01-17 00:40:13 +08:00
|
|
|
#include "shared/test/common/mocks/mock_device.h"
|
2022-06-30 03:17:47 +08:00
|
|
|
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
|
|
|
#include "shared/test/common/test_macros/test.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2022-08-11 22:01:11 +08:00
|
|
|
using Gen8DeviceCaps = Test<DeviceFixture>;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2021-12-23 17:28:36 +08:00
|
|
|
GEN8TEST_F(Gen8DeviceCaps, GivenDefaultWhenCheckingPreemptionModeThenDisabledIsReported) {
|
2017-12-21 07:45:38 +08:00
|
|
|
EXPECT_TRUE(PreemptionMode::Disabled == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
|
|
|
|
}
|
|
|
|
|
2021-12-23 17:28:36 +08:00
|
|
|
GEN8TEST_F(Gen8DeviceCaps, BdwProfilingTimerResolution) {
|
|
|
|
const auto &caps = pDevice->getDeviceInfo();
|
|
|
|
EXPECT_EQ(80u, caps.outProfilingTimerResolution);
|
2020-03-25 20:06:45 +08:00
|
|
|
}
|
|
|
|
|
2021-12-23 17:28:36 +08:00
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenHwInfoWhenRequestedComputeUnitsUsedForScratchThenReturnValidValue) {
|
|
|
|
const auto &hwInfo = pDevice->getHardwareInfo();
|
2022-12-08 20:22:35 +08:00
|
|
|
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
2020-03-25 20:06:45 +08:00
|
|
|
|
2021-12-23 17:28:36 +08:00
|
|
|
uint32_t expectedValue = hwInfo.gtSystemInfo.MaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice *
|
|
|
|
hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
|
|
|
|
|
2022-12-08 20:22:35 +08:00
|
|
|
EXPECT_EQ(expectedValue, gfxCoreHelper.getComputeUnitsUsedForScratch(pDevice->getRootDeviceEnvironment()));
|
2021-12-23 17:28:36 +08:00
|
|
|
EXPECT_EQ(expectedValue, pDevice->getDeviceInfo().computeUnitsUsedForScratch);
|
|
|
|
}
|
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenHwInfoWhenRequestedMaxFrontEndThreadsThenReturnValidValue) {
|
|
|
|
const auto &hwInfo = pDevice->getHardwareInfo();
|
|
|
|
|
2022-12-08 20:22:35 +08:00
|
|
|
EXPECT_EQ(GfxCoreHelper::getMaxThreadsForVfe(hwInfo), pDevice->getDeviceInfo().maxFrontEndThreads);
|
2021-12-23 17:28:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, GivenBdwWhenCheckftr64KBpagesThenFalse) {
|
|
|
|
EXPECT_FALSE(defaultHwInfo->capabilityTable.ftr64KBpages);
|
|
|
|
}
|
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, GivenDefaultSettingsWhenCheckingPreemptionModeThenPreemptionIsDisabled) {
|
|
|
|
EXPECT_TRUE(PreemptionMode::Disabled == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
|
2020-03-25 20:06:45 +08:00
|
|
|
}
|
|
|
|
|
2020-10-19 16:58:14 +08:00
|
|
|
GEN8TEST_F(Gen8DeviceCaps, WhenCheckingKmdNotifyMechanismThenPropertiesAreSetCorrectly) {
|
2018-03-23 02:48:03 +08:00
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableKmdNotify);
|
|
|
|
EXPECT_EQ(50000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayKmdNotifyMicroseconds);
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleep);
|
2018-03-28 19:26:48 +08:00
|
|
|
EXPECT_EQ(5000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepMicroseconds);
|
2018-03-23 02:48:03 +08:00
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForSporadicWaits);
|
|
|
|
EXPECT_EQ(200000, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForSporadicWaitsMicroseconds);
|
2021-12-18 02:42:13 +08:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission);
|
|
|
|
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
2020-10-19 16:58:14 +08:00
|
|
|
GEN8TEST_F(Gen8DeviceCaps, WhenCheckingCompressionThenItIsDisabled) {
|
2018-07-18 20:11:05 +08:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedBuffers);
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedImages);
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
2018-02-19 16:50:17 +08:00
|
|
|
|
2020-10-19 16:58:14 +08:00
|
|
|
GEN8TEST_F(Gen8DeviceCaps, WhenCheckingImage3dDimensionsThenCapsAreSetCorrectly) {
|
2020-03-12 16:33:20 +08:00
|
|
|
const auto &sharedCaps = pDevice->getDeviceInfo();
|
|
|
|
EXPECT_EQ(2048u, sharedCaps.image3DMaxDepth);
|
2018-02-19 16:50:17 +08:00
|
|
|
}
|
2018-12-05 23:09:27 +08:00
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenHwInfoWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
|
|
|
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
|
|
|
|
}
|
2018-12-06 22:33:02 +08:00
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckSupportCacheFlushAfterWalkerThenFalse) {
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker);
|
|
|
|
}
|
2019-04-16 15:06:37 +08:00
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckBlitterOperationsSupportThenReturnFalse) {
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.blitterOperationsSupported);
|
|
|
|
}
|
2019-08-20 21:17:10 +08:00
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue) {
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
2019-09-30 23:32:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingImageSupportThenReturnTrue) {
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages);
|
|
|
|
}
|
2021-05-13 22:58:26 +08:00
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingMediaBlockSupportThenReturnTrue) {
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsMediaBlock);
|
|
|
|
}
|
2023-03-07 01:07:06 +08:00
|
|
|
|
2021-10-27 00:15:57 +08:00
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingDeviceEnqueueSupportThenReturnFalse) {
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsDeviceEnqueue);
|
2021-12-23 17:28:36 +08:00
|
|
|
}
|
2023-03-07 01:07:06 +08:00
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingFloatAtomicsSupportThenReturnFalse) {
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsFloatAtomics);
|
|
|
|
}
|