2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2018-2021 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
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"
|
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-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-05-28 20:05:12 +08:00
|
|
|
typedef Test<ClDeviceFixture> Gen8DeviceCaps;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-10-19 16:58:14 +08:00
|
|
|
GEN8TEST_F(Gen8DeviceCaps, GivenDefaultSettingsWhenCheckingPreemptionModeThenPreemptionIsDisabled) {
|
2017-12-21 07:45:38 +08:00
|
|
|
EXPECT_TRUE(PreemptionMode::Disabled == pDevice->getHardwareInfo().capabilityTable.defaultPreemptionMode);
|
|
|
|
}
|
|
|
|
|
2020-03-25 20:06:45 +08:00
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckExtensionsThenDeviceProperlyReportsClKhrSubgroupsExtension) {
|
|
|
|
const auto &caps = pClDevice->getDeviceInfo();
|
2020-05-05 22:40:31 +08:00
|
|
|
if (pClDevice->areOcl21FeaturesEnabled()) {
|
2020-03-25 20:06:45 +08:00
|
|
|
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_subgroups")));
|
|
|
|
} else {
|
|
|
|
EXPECT_THAT(caps.deviceExtensions, ::testing::Not(testing::HasSubstr(std::string("cl_khr_subgroups"))));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingCapsThenDeviceDoesProperlyReportsIndependentForwardProgress) {
|
|
|
|
const auto &caps = pClDevice->getDeviceInfo();
|
|
|
|
|
2020-05-05 22:40:31 +08:00
|
|
|
if (pClDevice->areOcl21FeaturesEnabled()) {
|
2020-03-25 20:06:45 +08:00
|
|
|
EXPECT_TRUE(caps.independentForwardProgress != 0);
|
|
|
|
} else {
|
|
|
|
EXPECT_FALSE(caps.independentForwardProgress != 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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-06 01:13:32 +08:00
|
|
|
const auto &caps = pClDevice->getDeviceInfo();
|
2020-03-12 16:33:20 +08:00
|
|
|
const auto &sharedCaps = pDevice->getDeviceInfo();
|
2018-02-19 16:50:17 +08:00
|
|
|
EXPECT_EQ(2048u, caps.image3DMaxWidth);
|
2020-03-12 16:33:20 +08:00
|
|
|
EXPECT_EQ(2048u, sharedCaps.image3DMaxDepth);
|
2018-02-19 16:50:17 +08:00
|
|
|
EXPECT_EQ(2048u, caps.image3DMaxHeight);
|
|
|
|
}
|
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);
|
|
|
|
}
|
2021-10-27 00:15:57 +08:00
|
|
|
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingDeviceEnqueueSupportThenReturnFalse) {
|
|
|
|
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportsDeviceEnqueue);
|
|
|
|
}
|