Convenience and Correctness
Users can include a single header file
sdlt.hthat includes all the supported public features, or users can include the individual headers of features they will be using (which might build faster). In other words,
#include <sdlt/primitive.h> #include <sdlt/soa1d_container.h>
For convenience, SDLT provides a macro to encapsulate
#pragma forceinline recursive.
SDLT reduces overhead by trusting the programmer to pass it valid values for template and function parameters. Adding conditional checks inside of a SIMD loop can cause unnecessary code generation and inhibit vectorization by creating multiple exit points in a loop. To assist in verifying that a program is indeed passing valid values to SDLT, the programmer can add a compilation flag to their build to define
_DEBUGis defined and
SDLT_DEBUGhas not been defined to 0 or 1, then
SDLT_DEBUGis automatically set to 1. When set to 1, every operator is bounds checked and all addresses are validated for correct alignment. It is very useful for tracking down any usage bugs.
__SDLT_VERSIONis predefined to be 2001. Programs could use it for conditional compilation if incompatibilities arise in future updates.
C++ implementations of
std::maxsometimes have a negative impact on performance. SDLT defines
max_valthat help avoid such performance penalties.