Skip to content

Commit 98b1f8b

Browse files
feature: stateless appendPageFaultCopy
Related-to: NEO-11859 Signed-off-by: Damian Tomczak <[email protected]>
1 parent 4a226bb commit 98b1f8b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

level_zero/core/source/cmdlist/cmdlist_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendPageFaultCopy(NEO::Graph
13921392

13931393
size_t middleElSize = sizeof(uint32_t) * 4;
13941394
uintptr_t rightSize = size % middleElSize;
1395-
bool isStateless = this->cmdListHeapAddressModel == NEO::HeapAddressModel::globalStateless;
1395+
bool isStateless = (this->cmdListHeapAddressModel == NEO::HeapAddressModel::globalStateless) || this->isStatelessBuiltinsEnabled();
13961396
if (size >= 4ull * MemoryConstants::gigaByte) {
13971397
isStateless = true;
13981398
}

level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include "shared/source/gmm_helper/gmm_helper.h"
99
#include "shared/source/helpers/blit_commands_helper.h"
10+
#include "shared/source/helpers/compiler_product_helper.h"
1011
#include "shared/source/helpers/gfx_core_helper.h"
1112
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
1213
#include "shared/test/common/libult/ult_command_stream_receiver.h"
@@ -363,8 +364,9 @@ HWTEST2_F(CommandListCreate, givenCommandListWhenPageFaultCopyCalledThenappendPa
363364
MemoryManager::maxOsContextCount,
364365
canonizedGpuAddress);
365366
cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false);
367+
366368
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGACalledTimes, 1u);
367-
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, 0u);
369+
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, device->getNEODevice()->getCompilerProductHelper().isForceToStatelessRequired() ? 1u : 0u);
368370
}
369371

370372
HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledWithCopyEngineThenappendPageFaultCopyWithappendMemoryCopyKernelWithGACalled, MatchAny) {
@@ -429,7 +431,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledThenappendPa
429431
canonizedGpuAddress);
430432
cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false);
431433
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGACalledTimes, 2u);
432-
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, 0u);
434+
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, device->getNEODevice()->getCompilerProductHelper().isForceToStatelessRequired() ? 2u : 0u);
433435
}
434436

435437
HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledAndErrorOnMidCopyThenappendPageFaultCopyWithappendMemoryCopyKernelWithGACalledForMiddleIsCalled, MatchAny) {
@@ -462,7 +464,7 @@ HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledAndErrorOnMi
462464
canonizedGpuAddress);
463465
cmdList.appendPageFaultCopy(&mockAllocationDst, &mockAllocationSrc, size, false);
464466
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGACalledTimes, 1u);
465-
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, 0u);
467+
EXPECT_EQ(cmdList.appendMemoryCopyKernelWithGAStatelessCalledTimes, device->getNEODevice()->getCompilerProductHelper().isForceToStatelessRequired() ? 1u : 0u);
466468
}
467469

468470
HWTEST2_F(CommandListAppend, givenCommandListWhenPageFaultCopyCalledWithCopyEngineThenappendPageFaultCopyWithappendMemoryCopyCalledOnlyOnce, MatchAny) {

0 commit comments

Comments
 (0)