File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ // REQUIRES: level_zero, level_zero_dev_kit
2
+
3
+ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out
4
+ // RUN: env ZES_ENABLE_SYSMAN=1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER
5
+ //
6
+ // The test is to check that the free device memory is reported be Level Zero
7
+ // backend
8
+ //
9
+ // CHECK: Free device memory
10
+
11
+ #include < iostream>
12
+ #include < sycl/sycl.hpp>
13
+ using namespace sycl ;
14
+
15
+ int main () {
16
+
17
+ queue Queue;
18
+ auto dev = Queue.get_device ();
19
+ std::cout << " Device: " << dev.get_info <info::device::name>() << std::endl;
20
+
21
+ if (!dev.is_host () && dev.has (aspect::ext_intel_free_memory)) {
22
+ auto FreeMemory = dev.get_info <info::device::ext_intel_free_memory>();
23
+ std::cout << " Free device memory: " << FreeMemory << std::endl;
24
+ } else {
25
+ std::cout
26
+ << " Query ext_intel_device_info_free_memory not supported by the device"
27
+ << std::endl;
28
+ }
29
+
30
+ return 0 ;
31
+ }
You can’t perform that action at this time.
0 commit comments