DirectXMath
Fastor
Our great sponsors
DirectXMath | Fastor | |
---|---|---|
13 | 5 | |
1,481 | 702 | |
1.5% | - | |
6.8 | 4.3 | |
24 days ago | 16 days ago | |
C++ | C++ | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
DirectXMath
-
Vector math library benchmarks (C++)
For those unfamiliar, like I was, DXM is DirectXMath.
-
Learning DirectX 12 in 2023
Alongside MiniEngine, you’ll want to look into the DirectX Toolkit. This is a set of utilities by Microsoft that simplify graphics and game development. It contains libraries like DirectXMesh for parsing and optimizing meshes for DX12, or DirectXMath which handles 3D math operations like the OpenGL library glm. It also has utilities for gamepad input or sprite fonts. You can see a list of the headers here to get an idea of the features. You’ll definitely want to include this in your project if you don’t want to think about a lot of these solved problems (and don’t have to worry about cross-platform support).
-
Optimizing compilers reload vector constants needlessly
Bad news. For SIMD there are not cross-platform intrinsics. Intel intrinsics map directly to SSE/AVX instructions and ARM intrinsics map directly to NEON instructions.
For cross-platform, your best bet is probably https://github.com/VcDevel/std-simd
There's https://eigen.tuxfamily.org/index.php?title=Main_Page But, it's tremendously complicated for anything other than large-scale linear algebra.
And, there's https://github.com/microsoft/DirectXMath But, it has obvious biases :P
-
MATHRIL - Custom math library for game programming
I am not in gamedev, but work with 3D graphics, we use DirectX 11, so DirectXMath was a natural choice, it is header only, it supports SIMD instructions (SSE, AVX, NEON etc.), it can even be used on Linux (has no dependence on Windows). It of course just one choice: https://github.com/Microsoft/DirectXMath.
- When i had to look up what a Quaternion is
-
Eigen: A C++ template library for linear algebra
I never really used GLM, but Eigen was substantially slower than DirectXMath https://github.com/microsoft/DirectXMath for these things. Despite the name, 99% of that library is OS agnostic, only a few small pieces (like projection matrix formula) are specific to Direct3D. When enabled with corresponding macros, inline functions from that library normally compile into pretty efficient manually vectorized SSE, AVX or NEON code.
The only major issue, DirectXMath doesn’t support FP64 precision.
-
maths - templated c++ linear algebra library with vector swizzling, intersection tests and useful functions for games and graphics dev... includes live webgl/wasm demo ?
If you’re the author, consider comparisons with the industry standards, glm and DirectXMath, which both ensure easy interoperability with the two graphics APIs.
-
Algorithms for division: Using Newton's method
Good article, but note that if the hardware supports the division instruction, will be much faster than the described workarounds.
Personally, I recently did what’s written in 2 cases: FP32 division on ARMv7, and FP64 division on GPUs who don’t support that instruction.
For ARM CPUs, not only they have FRECPE, they also have FRECPS for the iteration step. An example there: https://github.com/microsoft/DirectXMath/blob/jan2021/Inc/Di...
For GPUs, Microsoft classified FP64 division as “extended double shader instruction” and the support is optional. However, GPUs are guaranteed to support FP32 division. The result of FP32 division provides an awesome starting point for Newton-Raphson refinement in FP64 precision.
-
Use of BLAS vs direct SIMD for linear algebra library operations?
For graphics DX math is a very good library.
-
Speeding Up `Atan2f` by 50x
I wonder how does it compare with Microsoft’s implementation, there: https://github.com/microsoft/DirectXMath/blob/jan2021/Inc/Di...
Based on the code your version is probably much faster. It would be interesting to compare precision still, MS uses 17-degree polynomial there.
Fastor
-
Standard way of doing maths with arrays?
I'm going to throw in a recommendation for Fastor. It is generally faster than other libraries, is very lightweight, and has a pretty modern syntax.
- LibRapid -- High Performance Arrays for C++
-
From Julia to C++ Struggle
There are C++ libraries that deal with linear algebra and tensors that are able to produce fully vectorized code without requiring you to mess around with SIMD intrinsics. See, for instance, fastor, blaze, eigen and the huge Trillinos set of packages. C++ is very widely used when it comes to scientific HPC applications. All you need to do is google search or better yet, join r/cpp and r/cpp_questions and start asking away for the things you need. The C++ community is very welcoming and full of experts that will be able to help you.
-
Use of BLAS vs direct SIMD for linear algebra library operations?
Picking what size you are targeting is really important, though. Could the matrices you are working with realistically be bigger than say 32x32? BLAS is good for big matrices. It's not as great for small matrices. Eigen or Fastor will do better for these smaller problems. And for various common operations on sizes 2, 3, and 4, hand coded graphics-oriented libraries might outperform those.
-
Scientific computing in Cpp
Tensorflow, Machine learning: https://www.tensorflow.org/ Fastor, A tensor library: https://github.com/romeric/Fastor GNU Scientific Library(GSL): https://www.gnu.org/software/gsl/ Boost. FEniCS, A finite element library: https://fenicsproject.org/ Intel MKL, a BLAS+LAPACK+other goodies library: https://software.intel.com/content/www/us/en/develop/tools/math-kernel-library.html SuiteSparse, A sparse linear algebra library: http://faculty.cse.tamu.edu/davis/suitesparse.html Sundials, Nonlinear solvers: https://computing.llnl.gov/projects/sundials
What are some alternatives?
GLM - OpenGL Mathematics (GLM)
xtensor - C++ tensors with broadcasting and lazy computing
highway - Performance-portable, length-agnostic SIMD with runtime dispatch
dynarray - A header-only library, VLA for C++ (≥C++14). Extended version of std::experimental::dynarray
libjxl - JPEG XL image format reference implementation
ITensors.jl - A Julia library for efficient tensor computations and tensor network calculations
glibc - GNU Libc
sundials - Official development repository for SUNDIALS - a SUite of Nonlinear and DIfferential/ALgebraic equation Solvers. Pull requests are welcome for bug fixes and minor changes.
Vc - SIMD Vector Classes for C++
SPTK - A suite of speech signal processing tools
highway - Highway - A Modern Javascript Transitions Manager
ArrayFire - ArrayFire: a general purpose GPU library.