File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
sycl/test-e2e/Adapters/level_zero Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 88
99#include < sycl/ext/oneapi/experimental/annotated_usm/alloc_shared.hpp>
1010
11+ #include < sycl/usm/usm_allocator.hpp>
12+
1113using namespace std ;
1214using namespace sycl ;
1315
@@ -24,7 +26,22 @@ int main(int argc, char *argv[]) {
2426 // CHECK: ---> urUSMSharedAlloc
2527 // CHECK-NOT: zeMemAllocShared
2628
27- free (ptr1, Q);
29+ sycl::usm_allocator<int , sycl::usm::alloc::shared> allocator_no_prop{Q};
30+
31+ auto ptr3 = allocator_no_prop.allocate (1 );
32+ // CHECK: ---> urUSMSharedAlloc
33+ // CHECK: zeMemAllocShared
34+
35+ sycl::usm_allocator<int , sycl::usm::alloc::shared> allocator_prop{
36+ Q, {sycl::ext::oneapi::property::usm::device_read_only{}}};
37+
38+ auto ptr4 = allocator_prop.allocate (1 );
39+ // CHECK: ---> urUSMSharedAlloc
40+ // CHECK-NOT: zeMemAllocShared
41+
42+ allocator_prop.deallocate (ptr4, 1 );
43+ allocator_no_prop.deallocate (ptr3, 1 );
2844 free (ptr2, Q);
45+ free (ptr1, Q);
2946 return 0 ;
3047}
You can’t perform that action at this time.
0 commit comments