https://github.com/eriksjolund/simd-diagonal-load
Header-only C++ library to load SIMD-vectors column-wise from a matrix but then use diagonally
https://github.com/eriksjolund/simd-diagonal-load
c-plus-plus diagonal header-only performance simd-intrinsics simd-library
Last synced: 3 months ago
JSON representation
Header-only C++ library to load SIMD-vectors column-wise from a matrix but then use diagonally
- Host: GitHub
- URL: https://github.com/eriksjolund/simd-diagonal-load
- Owner: eriksjolund
- License: mit
- Created: 2018-07-10T12:18:14.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-19T13:03:03.000Z (over 6 years ago)
- Last Synced: 2025-02-12T08:39:11.801Z (5 months ago)
- Topics: c-plus-plus, diagonal, header-only, performance, simd-intrinsics, simd-library
- Language: C++
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simd-diagonal-load
simd-diagonal-load is a C++ library that efficiently loads diagonals into SIMD vectors,
when the data is stored in such a way that only columns can be loaded.The problem is described in
https://stackoverflow.com/questions/15198011/how-to-load-a-sliding-diagonal-vector-from-data-stored-column-wise-withsse
A naive implementation could be formulated as:
```c++
int width=1000000; // a big number
uint8_t matrix[width][16];
fill_matrix_with_interesting_values(&matrix);for (int i=0; i < width - 16; ++i) {
uint8_t diagonal_vector[16];
for (int j=0; j<16; ++j) {
diagonal_vector[j] = matrix[i+j][j];
}
do_something(&diagonal_vector);
}
```This library is demnostrated in the
https://github.com/eriksjolund/simd-diagonal-load-json-demo#quick-demonstration