POSIX Shared Memory Data Structures 1.0
High-performance lock-free data structures for inter-process communication
|
Classes | |
class | SimdArray |
Helper class for SIMD operations on shm_array. More... | |
Functions | |
bool | is_aligned (const void *ptr, size_t alignment) noexcept |
Check if pointer is aligned to boundary. | |
float | sum_floats (const float *data, size_t count) noexcept |
Vectorized sum of float array using AVX2. | |
float | dot_product (const float *a, const float *b, size_t count) noexcept |
Vectorized dot product of two float arrays. | |
void | scale_floats (float *data, size_t count, float scale) noexcept |
Vectorized array scaling (multiply by scalar) | |
void | fma_floats (const float *a, const float *b, const float *c, float *result, size_t count) noexcept |
Vectorized FMA operation: result = a * b + c. | |
float | min_float (const float *data, size_t count) noexcept |
Find minimum value in float array. | |
float | max_float (const float *data, size_t count) noexcept |
Find maximum value in float array. | |
template<int distance = 1> | |
void | prefetch_read (const void *ptr) noexcept |
Prefetch data for read. | |
void | prefetch_write (void *ptr) noexcept |
Prefetch data for write. | |
void | stream_store_floats (float *dest, const float *src, size_t count) noexcept |
Stream store (bypass cache) for large arrays. | |
|
inlinenoexcept |
Vectorized dot product of two float arrays.
a | First array |
b | Second array |
count | Number of elements |
Definition at line 94 of file shm_simd_utils.h.
Referenced by calculate_kinetic_energy_simd(), and shm_simd::SimdArray< TableType >::dot().
|
inlinenoexcept |
Vectorized FMA operation: result = a * b + c.
a | First multiplicand array |
b | Second multiplicand array |
c | Addend array |
result | Output array |
count | Number of elements |
Definition at line 162 of file shm_simd_utils.h.
|
inlinenoexcept |
Check if pointer is aligned to boundary.
ptr | Pointer to check |
alignment | Required alignment (must be power of 2) |
Definition at line 28 of file shm_simd_utils.h.
Referenced by main(), and stream_store_floats().
|
inlinenoexcept |
Find maximum value in float array.
data | Input array |
count | Number of elements |
Definition at line 218 of file shm_simd_utils.h.
Referenced by shm_simd::SimdArray< TableType >::max().
|
inlinenoexcept |
Find minimum value in float array.
data | Input array |
count | Number of elements |
Definition at line 187 of file shm_simd_utils.h.
Referenced by shm_simd::SimdArray< TableType >::min().
|
inlinenoexcept |
Prefetch data for read.
ptr | Address to prefetch |
distance | How many cache lines ahead (0-3) |
Definition at line 251 of file shm_simd_utils.h.
|
inlinenoexcept |
Prefetch data for write.
ptr | Address to prefetch |
Definition at line 262 of file shm_simd_utils.h.
|
inlinenoexcept |
Vectorized array scaling (multiply by scalar)
data | Array to scale (modified in-place) |
count | Number of elements |
scale | Scale factor |
Definition at line 135 of file shm_simd_utils.h.
Referenced by calculate_kinetic_energy_simd(), and shm_simd::SimdArray< TableType >::scale().
|
inlinenoexcept |
Stream store (bypass cache) for large arrays.
dest | Destination (should be 32-byte aligned) |
src | Source data |
count | Number of floats to copy |
Definition at line 275 of file shm_simd_utils.h.
References is_aligned().
|
inlinenoexcept |
Vectorized sum of float array using AVX2.
data | Input array (should be 32-byte aligned for best performance) |
count | Number of elements |
Definition at line 47 of file shm_simd_utils.h.
Referenced by shm_simd::SimdArray< TableType >::sum().