File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed 
sycl/test-e2e/AddressSanitizer/common 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: linux
2+ //  RUN: %{build} %device_asan_flags -O2 -g -o %t
3+ //  RUN: %{run} %t 2>&1 | FileCheck %s
4+ //  RUN: env UR_LAYER_ASAN_OPTIONS=print_stats:1 %{run} %t 2>&1 | FileCheck --check-prefixes CHECK-STATS %s
5+ #include  < sycl/usm.hpp> 
6+ 
7+ // / This test is used to check enabling/disabling memory overhead statistics
8+ // / We always use "Stats" prefix in statistics message like asan
9+ 
10+ constexpr  std::size_t  N = 4 ;
11+ constexpr  std::size_t  group_size = 1 ;
12+ 
13+ int  main () {
14+   sycl::queue Q;
15+   int  *array = sycl::malloc_device<int >(1024  * 1024 , Q);
16+ 
17+   Q.submit ([&](sycl::handler &cgh) {
18+     auto  acc = sycl::local_accessor<int >(group_size, cgh);
19+     cgh.parallel_for <class  MyKernel >(
20+         sycl::nd_range<1 >(N, group_size), [=](sycl::nd_item<1 > item) {
21+           array[item.get_global_id ()] = acc[item.get_local_id ()];
22+         });
23+   });
24+   Q.wait ();
25+   //  CHECK-STATS: Stats
26+   //  CHECK-NOT: Stats
27+ 
28+   sycl::free (array, Q);
29+   std::cout << " PASS"   << std::endl;
30+   return  0 ;
31+ }
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments