API Reference
Utility functions and helper classes available in the project.
Overview
This reference documents utilities found in:
examples/02-memory-cache/include/memory_utils.hppexamples/04-simd-vectorization/include/simd_wrapper.hppbenchmarks/common/benchmark_utils.hpp
API Modules
Memory Utilities
Aligned allocation, cache-friendly containers, and prefetching.
Key Functions:
aligned_alloc()- Allocate aligned memoryaligned_free()- Free aligned memorymake_aligned()- Smart aligned allocationCacheLinePadded- Prevent false sharingprefetch_read()/prefetch_write()- Cache hints
Namespace: hpc::memory
SIMD Wrapper
Portable SIMD abstraction with operator overloading.
Key Classes:
SimdVec<T, Width>- SIMD vector classFloatVec- Default float vector type
Key Operations:
- Arithmetic:
+,-,*,/ horizontal_sum()- Reduce to scalarfmadd()- Fused multiply-addsqrt(),min(),max()
Namespace: hpc::simd
Benchmark Utilities
Benchmarking helpers and result export.
Key Functions:
DoNotOptimize()- Prevent optimizationClobberMemory()- Memory barrierexport_to_json()- Save resultscalculate_speedup()- Compare times
Key Classes:
BenchmarkResult- Single resultBenchmarkSuite- Result collectionTimer- Manual timing
Namespace: hpc::bench
Quick Reference
| Header | Namespace | Purpose |
|---|---|---|
memory_utils.hpp | hpc::memory | Memory optimization |
simd_wrapper.hpp | hpc::simd | SIMD operations |
benchmark_utils.hpp | hpc::bench | Benchmarking |