how to use sycl_cuda_pi usm manage memory? #7281
-
Describe the bug To Reproduce are there some example for new user to study sycl usm ? Environment (please complete the following information):
Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
cuda Managed Memory maps to USM shared memory in the cuda sycl backend as described in the SYCL 2020 spec https://github.com/intel/llvm-test-suite/blob/intel/SYCL/USM/memadvise_cuda.cpp. For basic usage see for example this test, https://github.com/intel/llvm-test-suite/blob/intel/SYCL/USM/depends_on.cpp, which allocates shared memory, operates on it on device, then checks results on host. You can also use memory advice hints on shared usm in the cuda backend as in this test: https://github.com/intel/llvm-test-suite/blob/intel/SYCL/USM/memadvise_cuda.cpp . Choosing good memory advice can improve performance is some cases as discussed e.g. here: https://developer.nvidia.com/blog/maximizing-unified-memory-performance-cuda/ |
Beta Was this translation helpful? Give feedback.
-
OK,Thank you |
Beta Was this translation helpful? Give feedback.
cuda Managed Memory maps to USM shared memory in the cuda sycl backend as described in the SYCL 2020 spec https://github.com/intel/llvm-test-suite/blob/intel/SYCL/USM/memadvise_cuda.cpp.
For basic usage see for example this test, https://github.com/intel/llvm-test-suite/blob/intel/SYCL/USM/depends_on.cpp, which allocates shared memory, operates on it on device, then checks results on host.
You can also use memory advice hints on shared usm in the cuda backend as in this test: https://github.com/intel/llvm-test-suite/blob/intel/SYCL/USM/memadvise_cuda.cpp . Choosing good memory advice can improve performance is some cases as discussed e.g. here: https://developer.nvidia.com/blog/maximizing…