@@ -971,24 +971,49 @@ TEST_P(zeImmediateCommandListExecutionTests,
971971 lzt::free_memory (memory);
972972}
973973
974+ TEST_P (
975+ zeImmediateCommandListExecutionTests,
976+ GivenImmediateCommandListWhenAppendMemoryPrefetchThenSuccessIsReturnedWithSharedSystemAllocator) {
977+ SKIP_IF_SHARED_SYSTEM_ALLOC_UNSUPPORTED ();
978+ size_t size = 4096 ;
979+ void *memory = lzt::aligned_malloc (size, 1 );
980+ EXPECT_EQ (ZE_RESULT_SUCCESS,
981+ zeCommandListAppendMemoryPrefetch (cmdlist_immediate, memory, size));
982+ EXPECT_EQ (ZE_RESULT_SUCCESS,
983+ zeCommandListHostSynchronize (cmdlist_immediate, timeout));
984+ lzt::aligned_free (memory);
985+ }
986+
974987static void RunAppendMemoryPrefetch (ze_command_list_handle_t cmdlist_immediate,
975- const uint64_t timeout) {
988+ const uint64_t timeout,
989+ bool is_shared_system) {
976990 size_t size = 4096 ;
977- void *memory = lzt::allocate_shared_memory (size);
991+ void *memory = lzt::allocate_shared_memory_with_allocator_selector (
992+ size, is_shared_system);
978993 EXPECT_EQ (ZE_RESULT_SUCCESS,
979994 zeCommandListAppendMemoryPrefetch (cmdlist_immediate, memory, size));
980995 EXPECT_EQ (ZE_RESULT_SUCCESS,
981996 zeCommandListHostSynchronize (cmdlist_immediate, timeout));
982- lzt::free_memory (memory);
997+ lzt::free_memory_with_allocator_selector (memory, is_shared_system );
983998}
984999
9851000TEST_F (
9861001 zeImmediateCommandListInOrderExecutionTests,
9871002 GivenInOrderImmediateCommandListWhenAppendMemoryPrefetchThenSuccessIsReturned) {
9881003 const uint64_t timeout = UINT64_MAX - 1 ;
989- RunAppendMemoryPrefetch (cmdlist_immediate_default_mode, timeout);
990- RunAppendMemoryPrefetch (cmdlist_immediate_sync_mode, 0 );
991- RunAppendMemoryPrefetch (cmdlist_immediate_async_mode, timeout);
1004+ RunAppendMemoryPrefetch (cmdlist_immediate_default_mode, timeout, false );
1005+ RunAppendMemoryPrefetch (cmdlist_immediate_sync_mode, 0 , false );
1006+ RunAppendMemoryPrefetch (cmdlist_immediate_async_mode, timeout, false );
1007+ }
1008+
1009+ TEST_F (
1010+ zeImmediateCommandListInOrderExecutionTests,
1011+ GivenInOrderImmediateCommandListWhenAppendMemoryPrefetchThenSuccessIsReturnedWithSharedSystemAllocator) {
1012+ SKIP_IF_SHARED_SYSTEM_ALLOC_UNSUPPORTED ();
1013+ const uint64_t timeout = UINT64_MAX - 1 ;
1014+ RunAppendMemoryPrefetch (cmdlist_immediate_default_mode, timeout, true );
1015+ RunAppendMemoryPrefetch (cmdlist_immediate_sync_mode, 0 , true );
1016+ RunAppendMemoryPrefetch (cmdlist_immediate_async_mode, timeout, true );
9921017}
9931018
9941019TEST_P (zeImmediateCommandListExecutionTests,
0 commit comments