Feat: SIMD Math support#422
Merged
Merged
Conversation
Add the benchmark/1.9.5 Conan dependency and a Benchmark support library that provides the BENCHMARK_MAIN entry point, plus an exp_add_benchmark CMake helper mirroring exp_add_test. Benchmarks are plain executables placed under the Benchmark folder and are not registered with ctest.
Assert took its name/file/reason as const std::string&, so every call site materialized a std::string from __FILE__ (a long absolute path that overflows SSO and heap-allocates), and AssertImpl was an out-of-line, side-effecting call the optimizer could not elide. On hot paths that went through Assert this was brutal: a single scalar 4x4 Mat multiply (Row/Col/At each assert) spent ~14.6us almost entirely in those allocations. Switch the parameters to const char* / std::string_view (literals pass by pointer, no allocation) and inline the passing branch into the header, leaving only the actual-failure handling out of line as Debug::AssertFailed. A compile-time-true condition now folds away entirely; a runtime one collapses to a single predicted-not-taken branch. Semantics are unchanged in every config. The same scalar MatMul benchmark drops from 14584ns to 49ns; Common.Test passes.
Reflected headers that pull in the math lib now transitively include <emmintrin.h>/<arm_neon.h> through Simd.h. MirrorTool's libclang cannot parse those (no clang resource headers on Linux, a version-mismatched arm_neon.h on macOS), breaking reflection on Ubuntu and macOS. Reflection only needs the declarations, never the vectorized bodies, so define MIRROR_TOOL_PARSING during the parse and stand in a portable scalar F32x4 instead of the intrinsic backend. Every real translation unit still compiles the SSE2/NEON path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.