@@ -616,6 +616,42 @@ HWCMDTEST_P(IGFX_GEN8_CORE, DeviceQueueHwWithKernel, setupIndirectStateSetsCorre
616616 }
617617}
618618
619+ HWCMDTEST_P (IGFX_GEN8_CORE, DeviceQueueHwWithKernel, GivenHasBarriersSetWhenCallingSetupIndirectStateThenAllIddHaveBarriersEnabled) {
620+ using GPGPU_WALKER = typename FamilyType::GPGPU_WALKER;
621+ using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
622+
623+ if (std::string (pPlatform->getDevice (0 )->getDeviceInfo ().clVersion ).find (" OpenCL 2." ) != std::string::npos) {
624+ pKernel->createReflectionSurface ();
625+
626+ MockContext mockContext;
627+ auto devQueueHw = std::make_unique<MockDeviceQueueHw<FamilyType>>(&mockContext, device, deviceQueueProperties::minimumProperties[0 ]);
628+ auto dsh = devQueueHw->getIndirectHeap (IndirectHeap::DYNAMIC_STATE);
629+
630+ uint32_t parentCount = 1 ;
631+
632+ auto blockManager = pKernel->getProgram ()->getBlockKernelManager ();
633+ auto iddCount = blockManager->getCount ();
634+ for (uint32_t i = 0 ; i < iddCount; i++) {
635+ ((SPatchExecutionEnvironment *)blockManager->getBlockKernelInfo (i)->patchInfo .executionEnvironment )->HasBarriers = 1u ;
636+ }
637+
638+ auto surfaceStateHeapSize =
639+ HardwareCommandsHelper<FamilyType>::getSizeRequiredForExecutionModel (IndirectHeap::SURFACE_STATE,
640+ const_cast <const Kernel &>(*pKernel));
641+ auto ssh = std::make_unique<IndirectHeap>(alignedMalloc (surfaceStateHeapSize, MemoryConstants::pageSize), surfaceStateHeapSize);
642+
643+ devQueueHw->setupIndirectState (*ssh, *dsh, pKernel, parentCount);
644+
645+ auto iddStartPtr = static_cast <INTERFACE_DESCRIPTOR_DATA *>(ptrOffset (dsh->getCpuBase (), devQueueHw->colorCalcStateSize ));
646+ auto iddStartIndex = parentCount;
647+ for (uint32_t i = 0 ; i < iddCount; i++) {
648+ EXPECT_TRUE (iddStartPtr[iddStartIndex + i].getBarrierEnable ());
649+ }
650+
651+ alignedFree (ssh->getCpuBase ());
652+ }
653+ }
654+
619655static const char *binaryFile = " simple_block_kernel" ;
620656static const char *KernelNames[] = {" kernel_reflection" , " simple_block_kernel" };
621657
0 commit comments