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
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
sorting_network_cpp offers templated implementations of various types of [sorting networks](https://en.wikipedia.org/wiki/Sorting_network) which can drastically improve performance for small problem sizes of simple data compared to regular sorting algorithms (e.g. `std::sort`).
4
4
5
-
Following listing shows the execution time for different algorithms to sort one million arrays of each 32 random `float` values on an AMD Ryzen 7 2700x @3.70 GHz (compiled with clang 12.0.0 `-O3`):
5
+
The following listing shows the execution time for different algorithms to sort one million arrays of each 32 random `float` values on an AMD Ryzen 7 2700x @3.70 GHz (compiled with clang 12.0.0 `-O3`):
The compare and swap operation is the fundamental element a sorting network is composed of. The default implementation works well on scalar types, but if you want to specify a custom implementation (e.g. when hardware intrinsics should be used) you may do this by providing a compare and swap functor to the `sorting_network::operator()` as in following example:
90
+
The compare and swap operation is the fundamental element a sorting network is composed of. The default implementation works well on scalar types. However, if you want to specify a custom implementation (e.g., when hardware intrinsics should be used), you may do this by providing a compare and swap functor to the `sorting_network::operator()` as in the following example:
A single header implementation is available which allows experimenting with the sorting networks on [godbolt](https://godbolt.org/z/69WMqMY3c).
108
+
A single header implementation is available which allows experimenting with the sorting networks on [****godbolt](https://godbolt.org/z/69WMqMY3c).
109
109
110
110
## Requirements
111
111
A compiler with C++17 support
112
112
113
113
## Dependencies
114
-
For the bare sorting functionality no dependencies are required. If you want to run the tests, the needed dependencies will be installed via conan.
114
+
For the bare sorting functionality, no dependencies are required. If you want to run the tests, the required dependencies will automatically be fetched via [CPM](https://github.com/cpm-cmake/CPM.cmake).
115
115
116
116
## Limitations
117
117
* Depending on the implementation of the comparator the performance advantage of a sorting net compared to a regular sorting algorithm (e.g. `std::sort`) may diminish or even result in worse performance. This can be seen in the [interactive benchmark results overview](https://raw.githack.com/quxflux/sorting_network_cpp/master/doc/data_explorer.htm) for the data type `Vec2i Z-order` which causes in most cases all variants of sorting networks being outperformed by `std::sort` (see [src/benchmark.cpp](src/benchmark.cpp) for the implementation of the aforementioned data type).
118
-
* msvc will fail compiling larger `insertion_sort` networks in certain (unknown) configurations with `fatal error C1202: recursive type or function dependency context too complex`
118
+
* msvc will fail to compile larger `insertion_sort` networks in certain (unknown) configurations with `fatal error C1202: recursive type or function dependency context too complex`
119
119
120
120
## Development notes
121
121
* A pre-push [githook](https://git-scm.com/docs/githooks) is available in [.githooks](./.githooks/) which will automatically create the single header implementation.
0 commit comments