Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shucharjer/alignmentarray
Added an aligned array class
https://github.com/shucharjer/alignmentarray
array assembly avx cpp
Last synced: 4 days ago
JSON representation
Added an aligned array class
- Host: GitHub
- URL: https://github.com/shucharjer/alignmentarray
- Owner: Shucharjer
- License: mit
- Created: 2023-12-24T17:06:51.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-18T07:40:46.000Z (11 months ago)
- Last Synced: 2024-12-14T20:14:14.449Z (about 2 months ago)
- Topics: array, assembly, avx, cpp
- Language: C++
- Homepage:
- Size: 1.18 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## AlignmentArray
try using align_val_t in std17 and simd assembly instructions to optimize the performance of array
to generate this project, you should using visual studio and its assembler
it has a runtime check for simd instructions
### Usage
- create a file "Definations.h" and copy the following code:
```c++
#pragma once#ifdef ALIGNMENT_EXPORTS
#define ALIGNMENT_API __declspec(dllexport)
#else
#define ALIGNMENT_API __declspec(dllimport)
#pragma comment(lib, "Alignment.lib")
#endif
```
- add additional library directories
- use it
```c++
Alignment::Array array(size_t, Alignment::AlignmentSize);
// size_t is the total size of the array. you could get it by the count of the elements times there single size(sizeof(T)).
// Alignment::AlignmentSize is the alignment(in bytes) of the array. It has a default value which is 16
```
basic types has already been added in