Managing heterogeneous device memory using C++17 memory resources
| Authors |
|
|---|---|
| Publication date | 2023 |
| Journal | Journal of Physics. Conference Series |
| Event | 20th International Workshop on Advanced Computing and Analysis Techniques in Physics Research |
| Article number | 012050 |
| Volume | Issue number | 2438 |
| Number of pages | 6 |
| Organisations |
|
| Abstract |
Programmers using the C++ programming language are increasingly taught to manage memory implicitly through containers provided by the C++ standard library. However, heterogeneous programming platforms often require explicit allocation and deallocation of memory. This discrepancy in memory management strategies can be daunting and problematic for C++ developers who are not already familiar with heterogeneous programming. The C++17 standard introduces the concept of memory resources, which allow the user to control how standard library containers allocate memory; we believe that this addition to the C++17 standard is a powerful tool towards the unification of memory management for heterogeneous systems with best-practice C++ development. In this paper, we present vecmem, a library of memory resources which allows efficient and user-friendly allocation of memory on CUDA, HIP, and SYCL devices through standard C++ containers. We investigate the design and use cases of such a library, the potential performance gains over naive memory allocation, and the limitations of this memory allocation model.
|
| Document type | Article |
| Note | 20th International Workshop on Advanced Computing and Analysis Techniques in Physics Research |
| Language | English |
| Published at | https://doi.org/10.1088/1742-6596/2438/1/012050 |
| Downloads |
Managing heterogeneous device memory using C++17 memory resources
(Final published version)
|
| Permalink to this page | |