This repository was archived by the owner on Mar 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ // REQUIRES: gpu, level_zero, level_zero_dev_kit
2
+ // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out
3
+ // RUN: env SYCL_PROGRAM_COMPILE_OPTIONS=-ze-intel-greater-than-4GB-buffer-required %GPU_RUN_PLACEHOLDER %t.out
4
+
5
+ #include < CL/sycl.hpp>
6
+ #include < iostream>
7
+
8
+ using namespace cl ::sycl;
9
+
10
+ const double Gb = 1024 * 1024 * 1024 ;
11
+
12
+ int main () {
13
+ auto D = device (gpu_selector ());
14
+
15
+ std::cout << " name = " << D.get_info <info::device::name>() << std::endl;
16
+
17
+ auto global_mem_size = D.get_info <info::device::global_mem_size>() / Gb;
18
+ std::cout << " global_mem_size = " << global_mem_size << std::endl;
19
+ std::cout << " max_mem_alloc_size = "
20
+ << D.get_info <info::device::max_mem_alloc_size>() / Gb << std::endl;
21
+
22
+ auto Q = queue (D);
23
+ for (int I = 1 ; I < global_mem_size; I++) {
24
+ void *p;
25
+ p = malloc_device (I * Gb, Q);
26
+ std::cout << " malloc_device(" << I << " Gb) = " << p << std::endl;
27
+ if (p == nullptr ) {
28
+ std::cout << " FAILED" << std::endl;
29
+ return -1 ;
30
+ }
31
+ sycl::free (p, Q);
32
+
33
+ p = malloc_shared (I * Gb, Q);
34
+ std::cout << " malloc_shared(" << I << " Gb) = " << p << std::endl;
35
+ if (p == nullptr ) {
36
+ std::cout << " FAILED" << std::endl;
37
+ return -1 ;
38
+ }
39
+ sycl::free (p, Q);
40
+ }
41
+
42
+ return 0 ;
43
+ }
Original file line number Diff line number Diff line change 1
1
// UNSUPPORTED: windows
2
2
//
3
+ // XFAIL: level_zero
4
+ // TODO: enable the test when L0 driver is honoring too large sizes.
5
+ //
3
6
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out
4
7
// RUN: %HOST_RUN_PLACEHOLDER %t1.out
5
8
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
You can’t perform that action at this time.
0 commit comments