|
8 | 8 | #include "shared/source/device/device.h" |
9 | 9 | #include "shared/source/device_binary_format/patchtokens_decoder.h" |
10 | 10 | #include "shared/source/helpers/basic_math.h" |
| 11 | +#include "shared/source/helpers/compiler_hw_info_config.h" |
11 | 12 | #include "shared/source/helpers/file_io.h" |
12 | 13 | #include "shared/source/helpers/hash.h" |
13 | 14 | #include "shared/source/memory_manager/surface.h" |
@@ -723,6 +724,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenContextIsCreatedThenCorrect |
723 | 724 | } |
724 | 725 |
|
725 | 726 | TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsExecutedThenGTPinCallbacksAreCalled) { |
| 727 | + |
| 728 | + const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); |
| 729 | + if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) { |
| 730 | + GTEST_SKIP(); |
| 731 | + } |
| 732 | + |
726 | 733 | gtpinCallbacks.onContextCreate = onContextCreate; |
727 | 734 | gtpinCallbacks.onContextDestroy = onContextDestroy; |
728 | 735 | gtpinCallbacks.onKernelCreate = onKernelCreate; |
@@ -873,6 +880,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsExecutedThenGTPinCa |
873 | 880 | } |
874 | 881 |
|
875 | 882 | TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelINTELIsExecutedThenGTPinCallbacksAreCalled) { |
| 883 | + |
| 884 | + const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); |
| 885 | + if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) { |
| 886 | + GTEST_SKIP(); |
| 887 | + } |
| 888 | + |
876 | 889 | gtpinCallbacks.onContextCreate = onContextCreate; |
877 | 890 | gtpinCallbacks.onContextDestroy = onContextDestroy; |
878 | 891 | gtpinCallbacks.onKernelCreate = onKernelCreate; |
@@ -1071,6 +1084,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelWithoutSSHIsUsedThenK |
1071 | 1084 | } |
1072 | 1085 |
|
1073 | 1086 | TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelWithoutSSHIsUsedThenGTPinSubmitKernelCallbackIsNotCalled) { |
| 1087 | + |
| 1088 | + const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); |
| 1089 | + if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) { |
| 1090 | + GTEST_SKIP(); |
| 1091 | + } |
| 1092 | + |
1074 | 1093 | gtpinCallbacks.onContextCreate = onContextCreate; |
1075 | 1094 | gtpinCallbacks.onContextDestroy = onContextDestroy; |
1076 | 1095 | gtpinCallbacks.onKernelCreate = onKernelCreate; |
@@ -1185,6 +1204,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelWithoutSSHIsUsedThenG |
1185 | 1204 | } |
1186 | 1205 |
|
1187 | 1206 | TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenBlockedKernelWithoutSSHIsUsedThenGTPinSubmitKernelCallbackIsNotCalled) { |
| 1207 | + |
| 1208 | + const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); |
| 1209 | + if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) { |
| 1210 | + GTEST_SKIP(); |
| 1211 | + } |
| 1212 | + |
1188 | 1213 | gtpinCallbacks.onContextCreate = onContextCreate; |
1189 | 1214 | gtpinCallbacks.onContextDestroy = onContextDestroy; |
1190 | 1215 | gtpinCallbacks.onKernelCreate = onKernelCreate; |
@@ -1308,6 +1333,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenBlockedKernelWithoutSSHIsUs |
1308 | 1333 | } |
1309 | 1334 |
|
1310 | 1335 | TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenTheSameKerneIsExecutedTwiceThenGTPinCreateKernelCallbackIsCalledOnce) { |
| 1336 | + |
| 1337 | + const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); |
| 1338 | + if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) { |
| 1339 | + GTEST_SKIP(); |
| 1340 | + } |
| 1341 | + |
1311 | 1342 | gtpinCallbacks.onContextCreate = onContextCreate; |
1312 | 1343 | gtpinCallbacks.onContextDestroy = onContextDestroy; |
1313 | 1344 | gtpinCallbacks.onKernelCreate = onKernelCreate; |
@@ -1471,6 +1502,10 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenTheSameKerneIsExecutedTwice |
1471 | 1502 | } |
1472 | 1503 |
|
1473 | 1504 | TEST_F(GTPinTests, givenMultipleKernelSubmissionsWhenOneOfGtpinSurfacesIsNullThenOnlyNonNullSurfacesAreMadeResident) { |
| 1505 | + const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); |
| 1506 | + if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) { |
| 1507 | + GTEST_SKIP(); |
| 1508 | + } |
1474 | 1509 | gtpinCallbacks.onContextCreate = onContextCreate; |
1475 | 1510 | gtpinCallbacks.onContextDestroy = onContextDestroy; |
1476 | 1511 | gtpinCallbacks.onKernelCreate = onKernelCreate; |
@@ -1533,6 +1568,8 @@ TEST_F(GTPinTests, givenMultipleKernelSubmissionsWhenOneOfGtpinSurfacesIsNullThe |
1533 | 1568 | auto pCmdQueue = castToObject<CommandQueue>(cmdQ); |
1534 | 1569 |
|
1535 | 1570 | gtpinNotifyKernelSubmit(pMultiDeviceKernel1, pCmdQueue); |
| 1571 | + |
| 1572 | + ASSERT_NE(0u, kernelExecQueue.size()); |
1536 | 1573 | EXPECT_EQ(nullptr, kernelExecQueue[0].gtpinResource); |
1537 | 1574 |
|
1538 | 1575 | CommandStreamReceiver &csr = pCmdQueue->getGpgpuCommandStreamReceiver(); |
@@ -1592,6 +1629,12 @@ TEST_F(GTPinTests, givenMultipleKernelSubmissionsWhenOneOfGtpinSurfacesIsNullThe |
1592 | 1629 | } |
1593 | 1630 |
|
1594 | 1631 | TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsCreatedThenAllKernelSubmitRelatedNotificationsAreCalled) { |
| 1632 | + |
| 1633 | + const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); |
| 1634 | + if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) { |
| 1635 | + GTEST_SKIP(); |
| 1636 | + } |
| 1637 | + |
1595 | 1638 | gtpinCallbacks.onContextCreate = onContextCreate; |
1596 | 1639 | gtpinCallbacks.onContextDestroy = onContextDestroy; |
1597 | 1640 | gtpinCallbacks.onKernelCreate = onKernelCreate; |
@@ -1787,6 +1830,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsCreatedThenAllKerne |
1787 | 1830 | } |
1788 | 1831 |
|
1789 | 1832 | TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenOneKernelIsSubmittedSeveralTimesThenCorrectBuffersAreMadeResident) { |
| 1833 | + |
| 1834 | + const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); |
| 1835 | + if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) { |
| 1836 | + GTEST_SKIP(); |
| 1837 | + } |
| 1838 | + |
1790 | 1839 | gtpinCallbacks.onContextCreate = onContextCreate; |
1791 | 1840 | gtpinCallbacks.onContextDestroy = onContextDestroy; |
1792 | 1841 | gtpinCallbacks.onKernelCreate = onKernelCreate; |
@@ -2035,6 +2084,11 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenLowMemoryConditionOccursThe |
2035 | 2084 | } |
2036 | 2085 |
|
2037 | 2086 | TEST_F(GTPinTests, givenKernelWithSSHThenVerifyThatSSHResizeWorksWell) { |
| 2087 | + const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); |
| 2088 | + if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) { |
| 2089 | + GTEST_SKIP(); |
| 2090 | + } |
| 2091 | + |
2038 | 2092 | cl_kernel kernel = nullptr; |
2039 | 2093 | cl_program pProgram = nullptr; |
2040 | 2094 | cl_device_id device = (cl_device_id)pDevice; |
@@ -2221,7 +2275,7 @@ TEST(GTPinOfflineTests, givenGtPinInDisabledStateWhenCallbacksFromEnqueuePathAre |
2221 | 2275 | auto dummyQueue = reinterpret_cast<void *>(0x1000); |
2222 | 2276 | uint32_t dummyCompletedTask = 0u; |
2223 | 2277 |
|
2224 | | - //now call gtpin function with dummy data, this must not crash |
| 2278 | + // now call gtpin function with dummy data, this must not crash |
2225 | 2279 | gtpinNotifyKernelSubmit(dummyKernel, dummyQueue); |
2226 | 2280 | gtpinNotifyPreFlushTask(dummyQueue); |
2227 | 2281 | gtpinNotifyTaskCompletion(dummyCompletedTask); |
@@ -2491,7 +2545,9 @@ HWTEST_F(GTPinTestsWithLocalMemory, givenGtPinCanUseSharedAllocationWhenGtPinBuf |
2491 | 2545 |
|
2492 | 2546 | HWTEST_F(GTPinTestsWithLocalMemory, givenGtPinCanUseSharedAllocationWhenGtPinBufferIsAllocatedInSharedMemoryThenSetSurfaceStateForTheBufferAndMakeItResident) { |
2493 | 2547 | GTPinHwHelper >pinHelper = GTPinHwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily); |
2494 | | - if (!gtpinHelper.canUseSharedAllocation(pDevice->getHardwareInfo())) { |
| 2548 | + const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily); |
| 2549 | + if (!gtpinHelper.canUseSharedAllocation(pDevice->getHardwareInfo()) || |
| 2550 | + compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) { |
2495 | 2551 | GTEST_SKIP(); |
2496 | 2552 | } |
2497 | 2553 |
|
|
0 commit comments