Skip to content

Commit c4cd8ac

Browse files
authored
[SYCLomatic] Add test for help function get_memory_info() (#141)
Signed-off-by: chenwei.sun <[email protected]>
1 parent 4cf4f9e commit c4cd8ac

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

help_function/src/dpct_device_info.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ int main() {
4848
if(device.is_accelerator())
4949
dev_info_output(device, "accelerator device");
5050

51+
size_t free_memory, global_memory;
52+
// Here just to test get_memory_info() to be called, as not all sycl backends
53+
// can support to query free memory, and return 0 for free memory if the
54+
// backend does not support it.
55+
dpct::get_current_device().get_memory_info(free_memory, global_memory);
56+
5157
printf("Test passed!\n");
5258
return 0;
5359
}

0 commit comments

Comments
 (0)