File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
sycl/test-e2e/Adapters/level_zero Expand file tree Collapse file tree 1 file changed +19
-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+
13+
1114using namespace std ;
1215using namespace sycl ;
1316
@@ -24,7 +27,22 @@ int main(int argc, char *argv[]) {
2427 // CHECK: ---> urUSMSharedAlloc
2528 // CHECK-NOT: zeMemAllocShared
2629
27- free (ptr1, Q);
30+ sycl::usm_allocator<int , sycl::usm::alloc::shared> allocator_no_prop{Q};
31+
32+ auto ptr3 = allocator_no_prop.allocate (1 );
33+ // CHECK: ---> urUSMSharedAlloc
34+ // CHECK: zeMemAllocShared
35+
36+ sycl::usm_allocator<int , sycl::usm::alloc::shared> allocator_prop{
37+ Q, {sycl::ext::oneapi::property::usm::device_read_only{}}};
38+
39+ auto ptr4 = allocator_prop.allocate (1 );
40+ // CHECK: ---> urUSMSharedAlloc
41+ // CHECK-NOT: zeMemAllocShared
42+
43+ allocator_prop.deallocate (ptr4, 1 );
44+ allocator_no_prop.deallocate (ptr3, 1 );
2845 free (ptr2, Q);
46+ free (ptr1, Q);
2947 return 0 ;
3048}
You can’t perform that action at this time.
0 commit comments