@@ -971,24 +971,49 @@ TEST_P(zeImmediateCommandListExecutionTests,
971
971
lzt::free_memory (memory);
972
972
}
973
973
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
+
974
987
static void RunAppendMemoryPrefetch (ze_command_list_handle_t cmdlist_immediate,
975
- const uint64_t timeout) {
988
+ const uint64_t timeout,
989
+ bool is_shared_system) {
976
990
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);
978
993
EXPECT_EQ (ZE_RESULT_SUCCESS,
979
994
zeCommandListAppendMemoryPrefetch (cmdlist_immediate, memory, size));
980
995
EXPECT_EQ (ZE_RESULT_SUCCESS,
981
996
zeCommandListHostSynchronize (cmdlist_immediate, timeout));
982
- lzt::free_memory (memory);
997
+ lzt::free_memory_with_allocator_selector (memory, is_shared_system );
983
998
}
984
999
985
1000
TEST_F (
986
1001
zeImmediateCommandListInOrderExecutionTests,
987
1002
GivenInOrderImmediateCommandListWhenAppendMemoryPrefetchThenSuccessIsReturned) {
988
1003
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 );
992
1017
}
993
1018
994
1019
TEST_P (zeImmediateCommandListExecutionTests,
0 commit comments