Skip to content

Commit 92a6b21

Browse files
committed
Add Getting Started section in main README file
- reorganize README.md
1 parent 310dbe1 commit 92a6b21

File tree

1 file changed

+95
-88
lines changed

1 file changed

+95
-88
lines changed

README.md

Lines changed: 95 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,92 @@
88
[![Nightly](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/nightly.yml/badge.svg?branch=main)](https://github.com/oneapi-src/unified-memory-framework/actions/workflows/nightly.yml)
99
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/oneapi-src/unified-memory-framework/badge)](https://securityscorecards.dev/viewer/?uri=github.com/oneapi-src/unified-memory-framework)
1010

11+
## Introduction
12+
1113
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.
1214

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 |
86+
| UMF_BUILD_TESTS | Build UMF tests | ON/OFF | ON |
87+
| UMF_BUILD_BENCHMARKS | Build UMF benchmarks | ON/OFF | OFF |
88+
| UMF_ENABLE_POOL_TRACKING | Build UMF with pool tracking | ON/OFF | ON |
89+
| UMF_DEVELOPER_MODE | Treat warnings as errors and enables additional checks | ON/OFF | OFF |
90+
| UMF_FORMAT_CODE_STYLE | Add clang-format-check and clang-format-apply targets to make | ON/OFF | OFF |
91+
| USE_ASAN | Enable AddressSanitizer checks | ON/OFF | OFF |
92+
| USE_UBSAN | Enable UndefinedBehaviorSanitizer checks | ON/OFF | OFF |
93+
| USE_TSAN | Enable ThreadSanitizer checks | ON/OFF | OFF |
94+
| USE_MSAN | Enable MemorySanitizer checks | ON/OFF | OFF |
95+
96+
## Architecture: memory pools and providers
1497

1598
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.
1699

@@ -20,13 +103,13 @@ UMF comes with predefined pool allocators (see include/pool) and providers (see
20103

21104
More detailed documentation is available here: https://oneapi-src.github.io/unified-memory-framework/
22105

23-
## Memory providers
106+
### Memory providers
24107

25-
### OS memory provider (Linux-only yet)
108+
#### OS memory provider (Linux-only yet)
26109

27110
A memory provider that provides memory from an operating system.
28111

29-
#### Requirements
112+
##### Requirements
30113

31114
1) Linux OS
32115
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.
35118
4) Required packages for tests:
36119
- libnuma-dev
37120

38-
## Memory pool managers
121+
### Memory pool managers
39122

40-
### proxy_pool (part of libumf)
123+
#### proxy_pool (part of libumf)
41124

42125
This memory pool is distributed as part of libumf. It forwards all requests to the underlying
43126
memory provider. Currently umfPoolRealloc, umfPoolCalloc and umfPoolMallocUsableSize functions
44127
are not supported by the proxy pool.
45128

46-
### libumf_pool_disjoint
129+
#### libumf_pool_disjoint
47130

48131
TODO: Add a description
49132

50-
#### Requirements
133+
##### Requirements
51134

52135
To enable this feature, the `UMF_BUILD_LIBUMF_POOL_DISJOINT` option needs to be turned `ON`.
53136

54-
### libumf_pool_jemalloc (Linux-only)
137+
#### libumf_pool_jemalloc (Linux-only)
55138

56139
libumf_pool_jemalloc is a [jemalloc](https://github.com/jemalloc/jemalloc)-based memory pool manager built as a separate static library.
57140
The `UMF_BUILD_LIBUMF_POOL_JEMALLOC` option has to be turned `ON` to build this library.
58141

59-
#### Requirements
142+
##### Requirements
60143

61144
1) The `UMF_BUILD_LIBUMF_POOL_JEMALLOC` option turned `ON`
62145
2) Required packages:
63146
- libjemalloc-dev
64147

65-
### libumf_pool_scalable (Linux-only)
148+
#### libumf_pool_scalable (Linux-only)
66149

67150
libumf_pool_scalable is a [oneTBB](https://github.com/oneapi-src/oneTBB)-based memory pool manager built as a separate static library.
68151
The `UMF_BUILD_LIBUMF_POOL_SCALABLE` option has to be turned `ON` to build this library.
69152

70-
#### Requirements
153+
##### Requirements
71154

72155
1) The `UMF_BUILD_LIBUMF_POOL_SCALABLE` option turned `ON`
73156
2) Required packages:
74157
- libtbb-dev (libraries: libtbbmalloc.so.2)
75158

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-
131159
## Contributions
132160

133161
All code has to be formatted using clang-format. To check the formatting do:
@@ -144,24 +172,3 @@ Additionally, to apply code formatting do:
144172
```bash
145173
$ make clang-format-apply
146174
```
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 |
159-
| UMF_BUILD_TESTS | Build UMF tests | ON/OFF | ON |
160-
| UMF_BUILD_BENCHMARKS | Build UMF benchmarks | ON/OFF | OFF |
161-
| UMF_ENABLE_POOL_TRACKING | Build UMF with pool tracking | ON/OFF | ON |
162-
| UMF_DEVELOPER_MODE | Treat warnings as errors and enables additional checks | ON/OFF | OFF |
163-
| UMF_FORMAT_CODE_STYLE | Add clang-format-check and clang-format-apply targets to make | ON/OFF | OFF |
164-
| USE_ASAN | Enable AddressSanitizer checks | ON/OFF | OFF |
165-
| USE_UBSAN | Enable UndefinedBehaviorSanitizer checks | ON/OFF | OFF |
166-
| USE_TSAN | Enable ThreadSanitizer checks | ON/OFF | OFF |
167-
| USE_MSAN | Enable MemorySanitizer checks | ON/OFF | OFF |

0 commit comments

Comments
 (0)