Skip to content

Commit 4d63cd9

Browse files
committed
Add Getting Started section in main README file
- reorganize README.md
1 parent 84559ef commit 4d63cd9

File tree

1 file changed

+96
-87
lines changed

1 file changed

+96
-87
lines changed

README.md

Lines changed: 96 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,94 @@
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+
## Getting started
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+
### 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 |
81+
| UMF_BUILD_TESTS | Build UMF tests | ON/OFF | ON |
82+
| UMF_BUILD_BENCHMARKS | Build UMF benchmarks | ON/OFF | OFF |
83+
| UMF_ENABLE_POOL_TRACKING | Build UMF with pool tracking | ON/OFF | ON |
84+
| UMF_DEVELOPER_MODE | Treat warnings as errors and enables additional checks | ON/OFF | OFF |
85+
| UMF_FORMAT_CODE_STYLE | Add clang-format-check and clang-format-apply targets to make | ON/OFF | OFF |
86+
| USE_ASAN | Enable AddressSanitizer checks | ON/OFF | OFF |
87+
| USE_UBSAN | Enable UndefinedBehaviorSanitizer checks | ON/OFF | OFF |
88+
| USE_TSAN | Enable ThreadSanitizer checks | ON/OFF | OFF |
89+
| USE_MSAN | Enable MemorySanitizer checks | ON/OFF | OFF |
90+
91+
### Usage
92+
93+
TODO: Change links to point to oneapi-src
94+
95+
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
1499

15100
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.
16101

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

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

23-
## Memory providers
108+
### Memory providers
24109

25-
### OS memory provider (Linux-only yet)
110+
#### OS memory provider (Linux-only yet)
26111

27112
A memory provider that provides memory from an operating system.
28113

29-
#### Requirements
114+
##### Requirements
30115

31116
1) Linux OS
32117
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.
35120
4) Required packages for tests:
36121
- libnuma-dev
37122

38-
## Memory pool managers
123+
### Memory pool managers
39124

40-
### libumf_pool_disjoint
125+
#### libumf_pool_disjoint
41126

42127
TODO: Add a description
43128

44-
#### Requirements
129+
##### Requirements
45130

46131
To enable this feature, the `UMF_BUILD_LIBUMF_POOL_DISJOINT` option needs to be turned `ON`.
47132

48-
### libumf_pool_jemalloc (Linux-only)
133+
#### libumf_pool_jemalloc (Linux-only)
49134

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

53-
#### Requirements
138+
##### Requirements
54139

55140
1) The `UMF_BUILD_LIBUMF_POOL_JEMALLOC` option turned `ON`
56141
2) Required packages:
57142
- libjemalloc-dev
58143

59-
### libumf_pool_scalable (Linux-only)
144+
#### libumf_pool_scalable (Linux-only)
60145

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

64-
#### Requirements
149+
##### Requirements
65150

66151
1) The `UMF_BUILD_LIBUMF_POOL_SCALABLE` option turned `ON`
67152
2) Required packages:
68153
- libtbb-dev (libraries: libtbbmalloc.so.2)
69154

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-
125155
## Contributions
126156

127157
All code has to be formatted using clang-format. To check the formatting do:
@@ -138,24 +168,3 @@ Additionally, to apply code formatting do:
138168
```bash
139169
$ make clang-format-apply
140170
```
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 |
153-
| UMF_BUILD_TESTS | Build UMF tests | ON/OFF | ON |
154-
| UMF_BUILD_BENCHMARKS | Build UMF benchmarks | ON/OFF | OFF |
155-
| UMF_ENABLE_POOL_TRACKING | Build UMF with pool tracking | ON/OFF | ON |
156-
| UMF_DEVELOPER_MODE | Treat warnings as errors and enables additional checks | ON/OFF | OFF |
157-
| UMF_FORMAT_CODE_STYLE | Add clang-format-check and clang-format-apply targets to make | ON/OFF | OFF |
158-
| USE_ASAN | Enable AddressSanitizer checks | ON/OFF | OFF |
159-
| USE_UBSAN | Enable UndefinedBehaviorSanitizer checks | ON/OFF | OFF |
160-
| USE_TSAN | Enable ThreadSanitizer checks | ON/OFF | OFF |
161-
| USE_MSAN | Enable MemorySanitizer checks | ON/OFF | OFF |

0 commit comments

Comments
 (0)