diff --git a/SYCL/USM/shared_read_only.cpp b/SYCL/USM/shared_read_only.cpp new file mode 100644 index 0000000000..0a16f9d195 --- /dev/null +++ b/SYCL/USM/shared_read_only.cpp @@ -0,0 +1,22 @@ +// REQUIRES: level_zero +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out +// RUN: env ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out 2> %t1.out; cat %t1.out %GPU_CHECK_PLACEHOLDER + +#include + +int main() { + sycl::queue q; + auto *p1 = sycl::malloc_shared( + 42, q, {sycl::ext::oneapi::property::usm::device_read_only()}); + auto *p2 = sycl::malloc_shared(42, q); + + // CHECK: zeMemAllocShared + // CHECK: {{zeCommandListAppendMemAdvise.*ZE_MEMORY_ADVICE_SET_READ_MOSTLY}} + // CHECK: {{zeCommandListAppendMemAdvise.*ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION*}} + // CHECK: zeMemAllocShared + // CHECK-NOT: MemAdvise + + free(p2, q); + free(p1, q); + return 0; +}