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