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