2019-09-19 01:32:33 +08:00
|
|
|
/*
|
2022-03-01 04:26:26 +08:00
|
|
|
* Copyright (C) 2019-2022 Intel Corporation
|
2019-09-19 01:32:33 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
2021-12-15 01:40:08 +08:00
|
|
|
#include "shared/test/common/test_macros/test.h"
|
2022-03-14 18:15:57 +08:00
|
|
|
#include "shared/test/unit_test/helpers/gtest_helpers.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2020-05-28 20:05:12 +08:00
|
|
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
2020-02-23 05:50:57 +08:00
|
|
|
|
2019-09-19 01:32:33 +08:00
|
|
|
using namespace NEO;
|
|
|
|
|
2020-05-28 20:05:12 +08:00
|
|
|
typedef Test<ClDeviceFixture> Gen12LpDeviceCaps;
|
2019-09-19 01:32:33 +08:00
|
|
|
|
2020-10-20 20:08:39 +08:00
|
|
|
HWTEST2_F(Gen12LpDeviceCaps, WhenCheckingExtensionStringThenFp64IsNotSupported, IsTGLLP) {
|
2020-03-06 01:13:32 +08:00
|
|
|
const auto &caps = pClDevice->getDeviceInfo();
|
2019-09-19 01:32:33 +08:00
|
|
|
std::string extensionString = caps.deviceExtensions;
|
|
|
|
|
|
|
|
EXPECT_EQ(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
|
|
|
|
EXPECT_EQ(0u, caps.doubleFpConfig);
|
|
|
|
}
|
|
|
|
|
2020-07-11 00:30:33 +08:00
|
|
|
HWTEST2_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckExtensionsThenSubgroupLocalBlockIOIsSupported, IsTGLLP) {
|
2020-03-06 01:13:32 +08:00
|
|
|
const auto &caps = pClDevice->getDeviceInfo();
|
2020-02-06 22:10:59 +08:00
|
|
|
|
2022-03-14 18:15:57 +08:00
|
|
|
EXPECT_TRUE(hasSubstr(caps.deviceExtensions, std::string("cl_intel_subgroup_local_block_io")));
|
2022-04-13 01:51:03 +08:00
|
|
|
EXPECT_TRUE(hasSubstr(caps.deviceExtensions, std::string("cl_intel_split_work_group_barrier")));
|
2020-02-06 22:10:59 +08:00
|
|
|
}
|
|
|
|
|
2020-07-11 00:30:33 +08:00
|
|
|
HWTEST2_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckExtensionsThenDeviceDoesNotReportClKhrSubgroupsExtension, IsTGLLP) {
|
2020-03-25 20:06:45 +08:00
|
|
|
const auto &caps = pClDevice->getDeviceInfo();
|
|
|
|
|
2022-03-14 18:15:57 +08:00
|
|
|
EXPECT_FALSE(hasSubstr(caps.deviceExtensions, std::string("cl_khr_subgroups")));
|
2020-03-25 20:06:45 +08:00
|
|
|
}
|
|
|
|
|
2020-07-11 00:30:33 +08:00
|
|
|
HWTEST2_F(Gen12LpDeviceCaps, givenGen12lpWhenCheckingCapsThenDeviceDoesNotSupportIndependentForwardProgress, IsTGLLP) {
|
2020-03-25 20:06:45 +08:00
|
|
|
const auto &caps = pClDevice->getDeviceInfo();
|
|
|
|
|
|
|
|
EXPECT_FALSE(caps.independentForwardProgress);
|
|
|
|
}
|
|
|
|
|
2020-10-20 20:08:39 +08:00
|
|
|
HWTEST2_F(Gen12LpDeviceCaps, WhenCheckingCapsThenCorrectlyRoundedDivideSqrtIsNotSupported, IsTGLLP) {
|
2020-03-06 01:13:32 +08:00
|
|
|
const auto &caps = pClDevice->getDeviceInfo();
|
2019-09-19 01:32:33 +08:00
|
|
|
EXPECT_EQ(0u, caps.singleFpConfig & CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT);
|
|
|
|
}
|
|
|
|
|
2020-10-20 20:08:39 +08:00
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, GivenDefaultWhenCheckingPreemptionModeThenMidThreadIsReported) {
|
2020-06-18 20:24:59 +08:00
|
|
|
EXPECT_EQ(PreemptionMode::MidThread, pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
2020-10-20 20:08:39 +08:00
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, WhenCheckingCapsThenProfilingTimerResolutionIs83) {
|
2020-03-12 16:33:20 +08:00
|
|
|
const auto &caps = pClDevice->getSharedDeviceInfo();
|
2019-09-19 01:32:33 +08:00
|
|
|
EXPECT_EQ(83u, caps.outProfilingTimerResolution);
|
|
|
|
}
|
|
|
|
|
2020-10-20 20:08:39 +08:00
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, WhenCheckingCapsThenKmdNotifyMechanismIsCorrectlyReported) {
|
2019-09-19 01:32:33 +08: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-18 02:42:13 +08:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission);
|
|
|
|
EXPECT_EQ(0, pDevice->getHardwareInfo().capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds);
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|
|
|
|
|
2020-10-20 20:08:39 +08:00
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, WhenCheckingCapsThenCompressionIsDisabled) {
|
2019-09-19 01:32:33 +08:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedBuffers);
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrRenderCompressedImages);
|
|
|
|
}
|
|
|
|
|
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, givenHwInfoWhenRequestedComputeUnitsUsedForScratchThenReturnValidValue) {
|
|
|
|
const auto &hwInfo = pDevice->getHardwareInfo();
|
|
|
|
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
|
|
|
|
|
|
|
uint32_t expectedValue = hwInfo.gtSystemInfo.MaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice * 8;
|
|
|
|
|
|
|
|
EXPECT_EQ(expectedValue, hwHelper.getComputeUnitsUsedForScratch(&hwInfo));
|
|
|
|
EXPECT_EQ(expectedValue, pDevice->getDeviceInfo().computeUnitsUsedForScratch);
|
|
|
|
}
|
|
|
|
|
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, givenHwInfoWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
|
|
|
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckBlitterOperationsSupportThenReturnFalse) {
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.blitterOperationsSupported);
|
|
|
|
}
|
|
|
|
|
2019-09-30 23:32:14 +08:00
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckingImageSupportThenReturnTrue) {
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages);
|
|
|
|
}
|
|
|
|
|
2021-05-13 22:58:26 +08:00
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckingMediaBlockSupportThenReturnTrue) {
|
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsMediaBlock);
|
|
|
|
}
|
|
|
|
|
2020-04-30 15:51:56 +08:00
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckingCoherencySupportThenReturnFalse) {
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsCoherency);
|
|
|
|
}
|
|
|
|
|
2020-07-11 00:30:33 +08:00
|
|
|
HWTEST2_F(Gen12LpDeviceCaps, givenTglLpWhenCheckSupportCacheFlushAfterWalkerThenFalse, IsTGLLP) {
|
2019-09-19 01:32:33 +08:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker);
|
|
|
|
}
|
|
|
|
|
2020-06-01 21:35:20 +08:00
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpDeviceWhenCheckingDeviceEnqueueSupportThenFalseIsReturned) {
|
2020-05-21 23:18:16 +08:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsDeviceEnqueue);
|
|
|
|
}
|
|
|
|
|
2020-06-10 01:24:28 +08:00
|
|
|
GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpDeviceWhenCheckingPipesSupportThenFalseIsReturned) {
|
2020-05-21 23:18:16 +08:00
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsPipes);
|
|
|
|
}
|
|
|
|
|
2020-05-28 20:05:12 +08:00
|
|
|
using TglLpUsDeviceIdTest = Test<ClDeviceFixture>;
|
2019-09-19 01:32:33 +08:00
|
|
|
|
2020-10-20 20:08:39 +08:00
|
|
|
HWTEST2_F(TglLpUsDeviceIdTest, WhenCheckingSimulationCapThenResultIsCorrect, IsTGLLP) {
|
2019-09-19 01:32:33 +08:00
|
|
|
unsigned short tglLpSimulationIds[2] = {
|
2020-11-05 23:01:58 +08:00
|
|
|
0xFF20,
|
2019-09-19 01:32:33 +08:00
|
|
|
0, // default, non-simulation
|
|
|
|
};
|
|
|
|
NEO::MockDevice *mockDevice = nullptr;
|
|
|
|
|
|
|
|
for (auto id : tglLpSimulationIds) {
|
|
|
|
mockDevice = createWithUsDeviceId(id);
|
|
|
|
ASSERT_NE(mockDevice, nullptr);
|
|
|
|
|
|
|
|
if (id == 0)
|
|
|
|
EXPECT_FALSE(mockDevice->isSimulation());
|
|
|
|
else
|
|
|
|
EXPECT_TRUE(mockDevice->isSimulation());
|
|
|
|
delete mockDevice;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-11 00:30:33 +08:00
|
|
|
HWTEST2_F(TglLpUsDeviceIdTest, GivenTGLLPWhenCheckftr64KBpagesThenTrue, IsTGLLP) {
|
2019-09-19 01:32:33 +08:00
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
|
|
|
|
}
|
|
|
|
|
2020-07-11 00:30:33 +08:00
|
|
|
HWTEST2_F(TglLpUsDeviceIdTest, givenGen12lpWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue, IsTGLLP) {
|
2019-10-30 23:14:50 +08:00
|
|
|
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
2019-09-19 01:32:33 +08:00
|
|
|
}
|