diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 138697b912..eb0f1ac1a6 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -1392,7 +1392,7 @@ ze_result_t CommandListCoreFamily::appendPageFaultCopy(NEO::Graph size_t middleElSize = sizeof(uint32_t) * 4; uintptr_t rightSize = size % middleElSize; - bool isStateless = this->cmdListHeapAddressModel == NEO::HeapAddressModel::globalStateless; + bool isStateless = (this->cmdListHeapAddressModel == NEO::HeapAddressModel::globalStateless) || this->isStatelessBuiltinsEnabled(); if (size >= 4ull * MemoryConstants::gigaByte) { isStateless = true; } diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp index 66c15dcbe4..59041344af 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp @@ -7,6 +7,7 @@ #include "shared/source/gmm_helper/gmm_helper.h" #include "shared/source/helpers/blit_commands_helper.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/test/common/cmd_parse/gen_cmd_parse.h" #include "shared/test/common/libult/ult_command_stream_receiver.h" @@ -363,8 +364,9 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledThenappendPa MemoryManager::maxOsContextCount, canonizedGpuAddress); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); + EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGACalledTimes, 1u); - EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, 0u); + EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, device->getNEODevice()->getCompilerProductHelper().isForceToStatelessRequired() ? 1u : 0u); } HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledWithCopyEngineThenappendPageFaultCopyWithappendMemoryCopyKernelWithGACalled, MatchAny) { @@ -429,7 +431,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledThenappendPa canonizedGpuAddress); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGACalledTimes, 2u); - EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, 0u); + EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, device->getNEODevice()->getCompilerProductHelper().isForceToStatelessRequired() ? 2u : 0u); } HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledAndErrorOnMidCopyThenappendPageFaultCopyWithappendMemoryCopyKernelWithGACalledForMiddleIsCalled, MatchAny) { @@ -462,7 +464,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledAndErrorOnMi canonizedGpuAddress); cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false); EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGACalledTimes, 1u); - EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, 0u); + EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, device->getNEODevice()->getCompilerProductHelper().isForceToStatelessRequired() ? 1u : 0u); } HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledWithCopyEngineThenappendPageFaultCopyWithappendMemoryCopyCalledOnlyOnce, MatchAny) {