Skip to content

Commit 67d7846

Browse files
Prepare ults for patch tokens cleanup
Signed-off-by: Kamil Kopryk <[email protected]> Related-To: IGC-5606
1 parent 7a58611 commit 67d7846

File tree

2 files changed

+62
-3
lines changed

2 files changed

+62
-3
lines changed

opencl/test/unit_test/command_queue/enqueue_kernel_1_tests.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
*/
77

8+
#include "shared/source/helpers/compiler_hw_info_config.h"
89
#include "shared/source/helpers/pause_on_gpu_properties.h"
910
#include "shared/source/helpers/preamble.h"
1011
#include "shared/test/common/helpers/debug_manager_state_restore.h"
@@ -554,14 +555,16 @@ HWTEST_F(EnqueueKernelTest, GivenGpuHangAndBlockingCallWhenEnqueingKernelThenOut
554555
}
555556

556557
HWTEST_F(EnqueueKernelTest, WhenEnqueingKernelThenIndirectDataIsAdded) {
558+
const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
559+
557560
auto dshBefore = pDSH->getUsed();
558561
auto iohBefore = pIOH->getUsed();
559562
auto sshBefore = pSSH->getUsed();
560563

561564
callOneWorkItemNDRKernel();
562565
EXPECT_TRUE(UnitTestHelper<FamilyType>::evaluateDshUsage(dshBefore, pDSH->getUsed(), &pKernel->getKernelInfo().kernelDescriptor, rootDeviceIndex));
563566
EXPECT_NE(iohBefore, pIOH->getUsed());
564-
if (pKernel->usesBindfulAddressingForBuffers() || pKernel->getKernelInfo().kernelDescriptor.kernelAttributes.flags.usesImages) {
567+
if ((pKernel->usesBindfulAddressingForBuffers() || pKernel->getKernelInfo().kernelDescriptor.kernelAttributes.flags.usesImages) && compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) {
565568
EXPECT_NE(sshBefore, pSSH->getUsed());
566569
}
567570
}

opencl/test/unit_test/gtpin/gtpin_tests.cpp

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "shared/source/device/device.h"
99
#include "shared/source/device_binary_format/patchtokens_decoder.h"
1010
#include "shared/source/helpers/basic_math.h"
11+
#include "shared/source/helpers/compiler_hw_info_config.h"
1112
#include "shared/source/helpers/file_io.h"
1213
#include "shared/source/helpers/hash.h"
1314
#include "shared/source/memory_manager/surface.h"
@@ -723,6 +724,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenContextIsCreatedThenCorrect
723724
}
724725

725726
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+
726733
gtpinCallbacks.onContextCreate = onContextCreate;
727734
gtpinCallbacks.onContextDestroy = onContextDestroy;
728735
gtpinCallbacks.onKernelCreate = onKernelCreate;
@@ -873,6 +880,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsExecutedThenGTPinCa
873880
}
874881

875882
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+
876889
gtpinCallbacks.onContextCreate = onContextCreate;
877890
gtpinCallbacks.onContextDestroy = onContextDestroy;
878891
gtpinCallbacks.onKernelCreate = onKernelCreate;
@@ -1071,6 +1084,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelWithoutSSHIsUsedThenK
10711084
}
10721085

10731086
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+
10741093
gtpinCallbacks.onContextCreate = onContextCreate;
10751094
gtpinCallbacks.onContextDestroy = onContextDestroy;
10761095
gtpinCallbacks.onKernelCreate = onKernelCreate;
@@ -1185,6 +1204,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelWithoutSSHIsUsedThenG
11851204
}
11861205

11871206
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+
11881213
gtpinCallbacks.onContextCreate = onContextCreate;
11891214
gtpinCallbacks.onContextDestroy = onContextDestroy;
11901215
gtpinCallbacks.onKernelCreate = onKernelCreate;
@@ -1308,6 +1333,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenBlockedKernelWithoutSSHIsUs
13081333
}
13091334

13101335
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+
13111342
gtpinCallbacks.onContextCreate = onContextCreate;
13121343
gtpinCallbacks.onContextDestroy = onContextDestroy;
13131344
gtpinCallbacks.onKernelCreate = onKernelCreate;
@@ -1471,6 +1502,10 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenTheSameKerneIsExecutedTwice
14711502
}
14721503

14731504
TEST_F(GTPinTests, givenMultipleKernelSubmissionsWhenOneOfGtpinSurfacesIsNullThenOnlyNonNullSurfacesAreMadeResident) {
1505+
const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
1506+
if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) {
1507+
GTEST_SKIP();
1508+
}
14741509
gtpinCallbacks.onContextCreate = onContextCreate;
14751510
gtpinCallbacks.onContextDestroy = onContextDestroy;
14761511
gtpinCallbacks.onKernelCreate = onKernelCreate;
@@ -1533,6 +1568,8 @@ TEST_F(GTPinTests, givenMultipleKernelSubmissionsWhenOneOfGtpinSurfacesIsNullThe
15331568
auto pCmdQueue = castToObject<CommandQueue>(cmdQ);
15341569

15351570
gtpinNotifyKernelSubmit(pMultiDeviceKernel1, pCmdQueue);
1571+
1572+
ASSERT_NE(0u, kernelExecQueue.size());
15361573
EXPECT_EQ(nullptr, kernelExecQueue[0].gtpinResource);
15371574

15381575
CommandStreamReceiver &csr = pCmdQueue->getGpgpuCommandStreamReceiver();
@@ -1592,6 +1629,12 @@ TEST_F(GTPinTests, givenMultipleKernelSubmissionsWhenOneOfGtpinSurfacesIsNullThe
15921629
}
15931630

15941631
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+
15951638
gtpinCallbacks.onContextCreate = onContextCreate;
15961639
gtpinCallbacks.onContextDestroy = onContextDestroy;
15971640
gtpinCallbacks.onKernelCreate = onKernelCreate;
@@ -1787,6 +1830,12 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsCreatedThenAllKerne
17871830
}
17881831

17891832
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+
17901839
gtpinCallbacks.onContextCreate = onContextCreate;
17911840
gtpinCallbacks.onContextDestroy = onContextDestroy;
17921841
gtpinCallbacks.onKernelCreate = onKernelCreate;
@@ -2035,6 +2084,11 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenLowMemoryConditionOccursThe
20352084
}
20362085

20372086
TEST_F(GTPinTests, givenKernelWithSSHThenVerifyThatSSHResizeWorksWell) {
2087+
const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
2088+
if (compilerHwInfoConfig.isForceToStatelessRequired() || !compilerHwInfoConfig.isStatelessToStatefulBufferOffsetSupported()) {
2089+
GTEST_SKIP();
2090+
}
2091+
20382092
cl_kernel kernel = nullptr;
20392093
cl_program pProgram = nullptr;
20402094
cl_device_id device = (cl_device_id)pDevice;
@@ -2221,7 +2275,7 @@ TEST(GTPinOfflineTests, givenGtPinInDisabledStateWhenCallbacksFromEnqueuePathAre
22212275
auto dummyQueue = reinterpret_cast<void *>(0x1000);
22222276
uint32_t dummyCompletedTask = 0u;
22232277

2224-
//now call gtpin function with dummy data, this must not crash
2278+
// now call gtpin function with dummy data, this must not crash
22252279
gtpinNotifyKernelSubmit(dummyKernel, dummyQueue);
22262280
gtpinNotifyPreFlushTask(dummyQueue);
22272281
gtpinNotifyTaskCompletion(dummyCompletedTask);
@@ -2491,7 +2545,9 @@ HWTEST_F(GTPinTestsWithLocalMemory, givenGtPinCanUseSharedAllocationWhenGtPinBuf
24912545

24922546
HWTEST_F(GTPinTestsWithLocalMemory, givenGtPinCanUseSharedAllocationWhenGtPinBufferIsAllocatedInSharedMemoryThenSetSurfaceStateForTheBufferAndMakeItResident) {
24932547
GTPinHwHelper &gtpinHelper = 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()) {
24952551
GTEST_SKIP();
24962552
}
24972553

0 commit comments

Comments
 (0)