Skip to content

Commit 2f0dbe0

Browse files
committed
add missing evict functo ze_loopback tests
1 parent 6921a3f commit 2f0dbe0

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

test/common/level_zero_mocks.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class LevelZeroMock : public LevelZero {
6464
MOCK_METHOD4(zeContextMakeMemoryResident,
6565
ze_result_t(ze_context_handle_t, ze_device_handle_t, void *,
6666
size_t));
67+
MOCK_METHOD4(zeContextEvictMemory,
68+
ze_result_t(ze_context_handle_t, ze_device_handle_t, void *,
69+
size_t));
6770
MOCK_METHOD2(zeMemFree,
6871
ze_result_t(ze_context_handle_t hContext, void *ptr));
6972

test/common/ze_loopback.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ ze_result_t ZE_APICALL zeContextMakeMemoryResident(ze_context_handle_t hContext,
263263
size);
264264
}
265265

266+
ze_result_t ZE_APICALL zeContextEvictMemory(ze_context_handle_t hContext,
267+
ze_device_handle_t hDevice,
268+
void *ptr, size_t size) {
269+
check_mock_present();
270+
return level_zero_mock->zeContextEvictMemory(hContext, hDevice, ptr, size);
271+
}
272+
266273
ze_result_t ZE_APICALL
267274
zeMemFreeExt(ze_context_handle_t hContext,
268275
const ze_memory_free_ext_desc_t *pMemFreeDesc, void *ptr) {

test/common/ze_loopback.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ EXPORTS
2424
zeCommandListAppendMemoryCopy
2525
zeCommandListAppendMemoryFill
2626
zeContextMakeMemoryResident
27+
zeContextEvictMemory
2728
zeMemGetAllocProperties
2829
zeMemAllocDevice
2930
zeMemAllocHost

test/common/ze_loopback.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class LevelZero {
2727
virtual ze_result_t zeContextMakeMemoryResident(ze_context_handle_t,
2828
ze_device_handle_t, void *,
2929
size_t) = 0;
30+
virtual ze_result_t zeContextEvictMemory(ze_context_handle_t,
31+
ze_device_handle_t, void *,
32+
size_t) = 0;
3033
virtual ze_result_t zeMemFree(ze_context_handle_t hContext, void *ptr) = 0;
3134
};
3235

test/common/ze_loopback.map

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
zeCommandListAppendMemoryCopy;
2424
zeCommandListAppendMemoryFill;
2525
zeContextMakeMemoryResident;
26+
zeContextEvictMemory;
2627
zeMemGetAllocProperties;
2728
zeMemAllocDevice;
2829
zeMemAllocHost;

0 commit comments

Comments
 (0)