You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Unified Memory Framework (UMF) is a library for constructing allocators and memory pools. It also contains broadly useful abstractions and utilities for memory management. UMF allows users to manage multiple memory pools characterized by different attributes, allowing certain allocation types to be isolated from others and allocated using different hardware resources as required.
12
14
13
-
# Architecture: memory pools and providers
15
+
## Usage
16
+
17
+
For a quick introduction to UMF usage, see [Example usage](https://oneapi-src.github.io/unified-memory-framework/example-usage.html),
18
+
which includes the code of the basic [example](https://github.com/oneapi-src/unified-memory-framework/blob/main/examples/basic/basic.c).
19
+
20
+
## Build
21
+
22
+
### Requirements
23
+
24
+
Required packages:
25
+
- C compiler
26
+
-[CMake](https://cmake.org/) >= 3.14.0
27
+
28
+
For development and contributions:
29
+
- clang-format-15.0 (can be installed with `python -m pip install clang-format==15.0.7`)
30
+
31
+
For building tests and Disjoint Pool:
32
+
- C++ compiler with C++17 support
33
+
34
+
### Linux
35
+
36
+
Executable and binaries will be in **build/bin**
37
+
38
+
```bash
39
+
$ mkdir build
40
+
$ cd build
41
+
$ cmake {path_to_source_dir}
42
+
$ make
43
+
```
44
+
45
+
### Windows
46
+
47
+
Generating Visual Studio Project. EXE and binaries will be in **build/bin/{build_config}**
48
+
49
+
```bash
50
+
$ mkdir build
51
+
$ cd build
52
+
$ cmake {path_to_source_dir} -G "Visual Studio 15 2017 Win64"
53
+
```
54
+
55
+
### Benchmark
56
+
57
+
A simple micro benchmark based on [ubench](https://github.com/sheredom/ubench.h).
58
+
In order to build the benchmark, the `UMF_BUILD_BENCHMARKS` CMake configuration flag has to be turned `ON`.
59
+
60
+
### Sanitizers
61
+
62
+
List of sanitizers available on Linux:
63
+
- AddressSanitizer
64
+
- UndefinedBehaviorSanitizer
65
+
- ThreadSanitizer
66
+
- Is mutually exclusive with other sanitizers.
67
+
- MemorySanitizer
68
+
- Requires linking against MSan-instrumented libraries to prevent false positive reports. More information [here](https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo).
69
+
70
+
List of sanitizers available on Windows:
71
+
- AddressSanitizer
72
+
73
+
Listed sanitizers can be enabled with appropriate [CMake options](#cmake-standard-options).
74
+
75
+
### CMake standard options
76
+
77
+
List of options provided by CMake:
78
+
79
+
| Name | Description | Values | Default |
80
+
| - | - | - | - |
81
+
| UMF_BUILD_SHARED_LIBRARY | Build UMF as shared library | ON/OFF | OFF |
82
+
| UMF_BUILD_OS_MEMORY_PROVIDER | Build OS memory provider | ON/OFF | ON |
83
+
| UMF_BUILD_LIBUMF_POOL_DISJOINT | Build the libumf_pool_disjoint static library | ON/OFF | OFF |
84
+
| UMF_BUILD_LIBUMF_POOL_JEMALLOC | Build the libumf_pool_jemalloc static library | ON/OFF | OFF |
85
+
| UMF_BUILD_LIBUMF_POOL_SCALABLE | Build the libumf_pool_scalable static library | ON/OFF | OFF |
A UMF memory pool is a combination of a pool allocator and a memory provider. A memory provider is responsible for coarse-grained memory allocations and management of memory pages, while the pool allocator controls memory pooling and handles fine-grained memory allocations.
16
99
@@ -20,13 +103,13 @@ UMF comes with predefined pool allocators (see include/pool) and providers (see
20
103
21
104
More detailed documentation is available here: https://oneapi-src.github.io/unified-memory-framework/
22
105
23
-
## Memory providers
106
+
###Memory providers
24
107
25
-
### OS memory provider (Linux-only yet)
108
+
####OS memory provider (Linux-only yet)
26
109
27
110
A memory provider that provides memory from an operating system.
28
111
29
-
#### Requirements
112
+
#####Requirements
30
113
31
114
1) Linux OS
32
115
2) The `UMF_BUILD_OS_MEMORY_PROVIDER` option turned `ON` (by default)
@@ -35,99 +118,44 @@ A memory provider that provides memory from an operating system.
35
118
4) Required packages for tests:
36
119
- libnuma-dev
37
120
38
-
## Memory pool managers
121
+
###Memory pool managers
39
122
40
-
### proxy_pool (part of libumf)
123
+
####proxy_pool (part of libumf)
41
124
42
125
This memory pool is distributed as part of libumf. It forwards all requests to the underlying
43
126
memory provider. Currently umfPoolRealloc, umfPoolCalloc and umfPoolMallocUsableSize functions
44
127
are not supported by the proxy pool.
45
128
46
-
### libumf_pool_disjoint
129
+
####libumf_pool_disjoint
47
130
48
131
TODO: Add a description
49
132
50
-
#### Requirements
133
+
#####Requirements
51
134
52
135
To enable this feature, the `UMF_BUILD_LIBUMF_POOL_DISJOINT` option needs to be turned `ON`.
53
136
54
-
### libumf_pool_jemalloc (Linux-only)
137
+
####libumf_pool_jemalloc (Linux-only)
55
138
56
139
libumf_pool_jemalloc is a [jemalloc](https://github.com/jemalloc/jemalloc)-based memory pool manager built as a separate static library.
57
140
The `UMF_BUILD_LIBUMF_POOL_JEMALLOC` option has to be turned `ON` to build this library.
58
141
59
-
#### Requirements
142
+
#####Requirements
60
143
61
144
1) The `UMF_BUILD_LIBUMF_POOL_JEMALLOC` option turned `ON`
62
145
2) Required packages:
63
146
- libjemalloc-dev
64
147
65
-
### libumf_pool_scalable (Linux-only)
148
+
####libumf_pool_scalable (Linux-only)
66
149
67
150
libumf_pool_scalable is a [oneTBB](https://github.com/oneapi-src/oneTBB)-based memory pool manager built as a separate static library.
68
151
The `UMF_BUILD_LIBUMF_POOL_SCALABLE` option has to be turned `ON` to build this library.
69
152
70
-
#### Requirements
153
+
#####Requirements
71
154
72
155
1) The `UMF_BUILD_LIBUMF_POOL_SCALABLE` option turned `ON`
73
156
2) Required packages:
74
157
- libtbb-dev (libraries: libtbbmalloc.so.2)
75
158
76
-
## Building
77
-
78
-
### Requirements
79
-
80
-
Required packages:
81
-
- C compiler
82
-
-[CMake](https://cmake.org/) >= 3.14.0
83
-
84
-
For development and contributions:
85
-
- clang-format-15.0 (can be installed with `python -m pip install clang-format==15.0.7`)
86
-
87
-
For building tests and Disjoint Pool:
88
-
- C++ compiler with C++17 support
89
-
90
-
### Benchmark
91
-
92
-
A simple micro benchmark based on [ubench](https://github.com/sheredom/ubench.h).
93
-
In order to build the benchmark, the `UMF_BUILD_BENCHMARKS` CMake configuration flag has to be turned `ON`.
94
-
95
-
### Windows
96
-
97
-
Generating Visual Studio Project. EXE and binaries will be in **build/bin/{build_config}**
98
-
99
-
```bash
100
-
$ mkdir build
101
-
$ cd build
102
-
$ cmake {path_to_source_dir} -G "Visual Studio 15 2017 Win64"
103
-
```
104
-
105
-
### Linux
106
-
107
-
Executable and binaries will be in **build/bin**
108
-
109
-
```bash
110
-
$ mkdir build
111
-
$ cd build
112
-
$ cmake {path_to_source_dir}
113
-
$ make
114
-
```
115
-
116
-
### Sanitizers
117
-
118
-
List of sanitizers available on Linux:
119
-
- AddressSanitizer
120
-
- UndefinedBehaviorSanitizer
121
-
- ThreadSanitizer
122
-
- Is mutually exclusive with other sanitizers.
123
-
- MemorySanitizer
124
-
- Requires linking against MSan-instrumented libraries to prevent false positive reports. More information [here](https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo).
125
-
126
-
List of sanitizers available on Windows:
127
-
- AddressSanitizer
128
-
129
-
Listed sanitizers can be enabled with appropriate [CMake options](#cmake-standard-options).
130
-
131
159
## Contributions
132
160
133
161
All code has to be formatted using clang-format. To check the formatting do:
@@ -144,24 +172,3 @@ Additionally, to apply code formatting do:
144
172
```bash
145
173
$ make clang-format-apply
146
174
```
147
-
148
-
### CMake standard options
149
-
150
-
List of options provided by CMake:
151
-
152
-
| Name | Description | Values | Default |
153
-
| - | - | - | - |
154
-
| UMF_BUILD_SHARED_LIBRARY | Build UMF as shared library | ON/OFF | OFF |
155
-
| UMF_BUILD_OS_MEMORY_PROVIDER | Build OS memory provider | ON/OFF | ON |
156
-
| UMF_BUILD_LIBUMF_POOL_DISJOINT | Build the libumf_pool_disjoint static library | ON/OFF | OFF |
157
-
| UMF_BUILD_LIBUMF_POOL_JEMALLOC | Build the libumf_pool_jemalloc static library | ON/OFF | OFF |
158
-
| UMF_BUILD_LIBUMF_POOL_SCALABLE | Build the libumf_pool_scalable static library | ON/OFF | OFF |
0 commit comments