@@ -432,6 +432,36 @@ TEST_F(KernelArgBufferTest, givenInvalidKernelObjWhenHasDirectStatelessAccessToH
432432 EXPECT_FALSE (pKernel->hasDirectStatelessAccessToHostMemory ());
433433}
434434
435+ TEST_F (KernelArgBufferTest, givenKernelWithIndirectStatelessAccessWhenHasIndirectStatelessAccessToHostMemoryIsCalledThenReturnTrueForHostMemoryAllocations) {
436+ KernelInfo kernelInfo;
437+ EXPECT_FALSE (kernelInfo.hasIndirectStatelessAccess );
438+
439+ MockKernel kernelWithNoIndirectStatelessAccess (pProgram, MockKernel::toKernelInfoContainer (kernelInfo, 0 ));
440+ EXPECT_FALSE (kernelWithNoIndirectStatelessAccess.hasIndirectStatelessAccessToHostMemory ());
441+
442+ kernelInfo.hasIndirectStatelessAccess = true ;
443+
444+ MockKernel kernelWithNoIndirectHostAllocations (pProgram, MockKernel::toKernelInfoContainer (kernelInfo, 0 ));
445+ EXPECT_FALSE (kernelWithNoIndirectHostAllocations.hasIndirectStatelessAccessToHostMemory ());
446+
447+ const auto allocationTypes = {GraphicsAllocation::AllocationType::BUFFER,
448+ GraphicsAllocation::AllocationType::BUFFER_COMPRESSED,
449+ GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY};
450+
451+ MockKernel kernelWithIndirectUnifiedMemoryAllocation (pProgram, MockKernel::toKernelInfoContainer (kernelInfo, 0 ));
452+ MockGraphicsAllocation gfxAllocation;
453+ for (const auto type : allocationTypes) {
454+ gfxAllocation.setAllocationType (type);
455+ kernelWithIndirectUnifiedMemoryAllocation.setUnifiedMemoryExecInfo (&gfxAllocation);
456+ if (type == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) {
457+ EXPECT_TRUE (kernelWithIndirectUnifiedMemoryAllocation.hasIndirectStatelessAccessToHostMemory ());
458+ } else {
459+ EXPECT_FALSE (kernelWithIndirectUnifiedMemoryAllocation.hasIndirectStatelessAccessToHostMemory ());
460+ }
461+ kernelWithIndirectUnifiedMemoryAllocation.clearUnifiedMemoryExecInfo ();
462+ }
463+ }
464+
435465TEST_F (KernelArgBufferTest, whenSettingAuxTranslationRequiredThenIsAuxTranslationRequiredReturnsCorrectValue) {
436466 for (auto auxTranslationRequired : {false , true }) {
437467 pKernel->setAuxTranslationRequired (auxTranslationRequired);
0 commit comments