2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2022-03-14 10:15:57 +00:00
|
|
|
* Copyright (C) 2018-2022 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/gen9/hw_cmds.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
2022-10-28 13:51:20 +00:00
|
|
|
#include "shared/test/common/fixtures/device_fixture.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-10-28 13:51:20 +00:00
|
|
|
using Gen9DeviceCaps = Test<DeviceFixture>;
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2020-10-26 14:57:52 +01:00
|
|
|
GEN9TEST_F(Gen9DeviceCaps, GivenDefaultWhenCheckingPreemptionModeThenMidThreadIsSupported) {
|
2018-01-12 14:18:53 +01:00
|
|
|
EXPECT_EQ(PreemptionMode::MidThread, pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
|
2020-10-26 14:57:52 +01:00
|
|
|
GEN9TEST_F(Gen9DeviceCaps, 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-06-06 08:45:45 +02:00
|
|
|
|
|
|
|
|
GEN9TEST_F(Gen9DeviceCaps, givenHwInfoWhenRequestedComputeUnitsUsedForScratchThenReturnValidValue) {
|
|
|
|
|
const auto &hwInfo = pDevice->getHardwareInfo();
|
2022-11-10 13:56:53 +00:00
|
|
|
auto &coreHelper = getHelper<CoreHelper>();
|
2018-06-06 08:45:45 +02:00
|
|
|
|
2019-05-08 16:00:24 +02:00
|
|
|
uint32_t expectedValue = hwInfo.gtSystemInfo.MaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice *
|
|
|
|
|
hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
|
2018-06-06 08:45:45 +02:00
|
|
|
|
2022-11-10 13:56:53 +00:00
|
|
|
EXPECT_EQ(expectedValue, coreHelper.getComputeUnitsUsedForScratch(pDevice->getRootDeviceEnvironment()));
|
2018-06-06 08:45:45 +02:00
|
|
|
EXPECT_EQ(expectedValue, pDevice->getDeviceInfo().computeUnitsUsedForScratch);
|
|
|
|
|
}
|
2018-12-05 07:09:27 -08:00
|
|
|
|
2019-05-29 15:37:54 +02:00
|
|
|
GEN9TEST_F(Gen9DeviceCaps, givenHwInfoWhenRequestedMaxFrontEndThreadsThenReturnValidValue) {
|
|
|
|
|
const auto &hwInfo = pDevice->getHardwareInfo();
|
|
|
|
|
|
|
|
|
|
EXPECT_EQ(HwHelper::getMaxThreadsForVfe(hwInfo), pDevice->getDeviceInfo().maxFrontEndThreads);
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-05 07:09:27 -08:00
|
|
|
GEN9TEST_F(Gen9DeviceCaps, givenHwInfoWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
|
|
|
|
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
|
|
|
|
|
}
|
2018-12-06 15:33:02 +01:00
|
|
|
|
|
|
|
|
GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckSupportCacheFlushAfterWalkerThenFalse) {
|
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker);
|
|
|
|
|
}
|
2019-04-16 09:06:37 +02:00
|
|
|
|
|
|
|
|
GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckBlitterOperationsSupportThenReturnFalse) {
|
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.blitterOperationsSupported);
|
2019-09-30 17:32:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckingImageSupportThenReturnTrue) {
|
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages);
|
|
|
|
|
}
|
2021-05-13 14:58:26 +00:00
|
|
|
|
|
|
|
|
GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckingMediaBlockSupportThenReturnTrue) {
|
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsMediaBlock);
|
|
|
|
|
}
|