Skip to content

Fastor V0.3

Compare
Choose a tag to compare
@romeric romeric released this 17 Apr 04:52
· 670 commits to master since this release

This release brings lots fundamental new features, performance improvements and bug fixes to Fastor, in particular

  1. Tensor views provide the ability to index, slice and broadcast multi-dimensional tensors using ranges/sequences/other tensors much like NumPy/MATLAB arrays. See the documentation.
  2. The evaluation mechanism in Fastor so far used static_casting for chaining operations in the corresponding eval functions. This used to generate a lot of unnecessary type conversion code. Starting from V0.3 the eval functions are well-informed leading to faster and much cleaner code and helping the compiler optimise much more.
  3. Support for FMA. The matmul, norm and inner functions and multiple other tensor overloads now use FMA instructions when available.
  4. Support for norm, inner, sum and product functions for any type of expressions.
  5. Bug fix in generic transpose and 2D SP transpose methods.
  6. Code splitting and plugins for cleaner maintainable code base.
  7. Division instructions can safely be dispatched to multiplication while hoisting the reciprocal out of the loop for expressions of type Expr / Scalar.
  8. FASTOR_FAST_MATH and FASTOR_UNSAFE_MATH are introduced. The FASTOR_UNSAFE_MATH flag turns Expr / Scalar expressions to approximate reciprocal and multiplication intrinsics, which can harm the accuracy. FASTOR_FAST_MATH is just a place holder macro activated by default under -Ofast.
  9. Lots of new test cases introduced.
  10. New benchmark problems for views and finite difference introduced.
  11. scalar_type was not correctly implemented for expressions. Now fixed.
  12. Equal rank tensor assignment restriction is now relaxed in order for expressions and views of any rank to be assigned to expressions of a different rank, as long as their size (capacity) is equal.
  13. Many functions are decorated inline and constexpr. This helps the compiler generate very compact code and aggressively eliminate dead code.
  14. Low and high rank tensors can be created using brace initialisers.
  15. Fix the SP/DP bug in matmul.
  16. Introduce the now very recommended -DNDEBUG flags to most Makefiles.
  17. Lots of other minor improvements and bug fixes.

As a final note, while compiling views mixed with other complex expression it is really beneficial to add the inlining flags to the compiler, such as -finline-limit=n for GCC, -mllvm -inline-threshold=n for Clang and -inline-forceinline -inline-factor=n for ICC, and although overlapping assignments are provided for convenience, it helps the compiler a lot in inlining if -DFASTOR_NO_ALIAS is issused. Also for 1D and 2D views -FASTOR_USE_VECTORISED_ASSIGN can cut down runtimes by a factor of 2-4, if compiler is successful at inlining.