Introduce VCL, SIMD wrappers, and Vectorized RasterizeSDF(Spheres)#2190
Open
Idclip wants to merge 7 commits intoAcademySoftwareFoundation:masterfrom
Open
Introduce VCL, SIMD wrappers, and Vectorized RasterizeSDF(Spheres)#2190Idclip wants to merge 7 commits intoAcademySoftwareFoundation:masterfrom
Idclip wants to merge 7 commits intoAcademySoftwareFoundation:masterfrom
Conversation
…7883e0ed9ce6 Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
Idclip
commented
Apr 8, 2026
Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
…alar arithmetic Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
…. RasterizeSDF with spheres Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
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.
This PR proposed to bring in Agner Fog's vectorclass (VCL) library as an internal but optional dependency on x86/x86_64 architecture. It then introduces some further infrastructure to improve/tidy our x86 intrinsic usage/ISA targeting, along with an additional wrapper header
openvdb/simd/Simd.hwhich wraps the VCLVeccontainers within aopenvdb::simdnamespace. This second level of wrapping exists to:std::simd)Note that the later point is crucial - this encourages us to write code that is more applicable to SIMD concepts, regardless of whether VCL/ISA targeting is in use. Many tools in VDB are inherently memory bound; that is, lots of data reading, little computation. Even when explicitly disabling compiler vectorization for specific x86 ISA's, there are notable performance improvements to be observed in many methods simply be restructuring inner loops to work on multiple components (i.e. many inner loops vs many outer loops).
Finally, to keep this PR small and primarily infrastructural, it contains one vectorized tool port,
rasterizeSdf(SphereSettings), which demonstrates how to both migrate from AoS->SoA and port existing scalar code to a templated method for VCL, Tuple and scalar arithmetic types. This implementation works with and without VCL.The following table demonstrates the observed speedups with all configurations:
Note that this particular tool requires no discussion over determinism of horizontal reduction or Intel vs AMD instruction specs - that is, there are no horizontal accumulations and no reciprocal emissions for this case. We can deffer this discussion to a future PR.
I have working implementations of the following which, should this PR be accepted, I can further contribute:
rasterizeSdf(SmoothSpheres)rasterizeSdf(Ellipsoids)rasterizeTrilinearpca