INTEL CONFIDENTIAL Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Other names and brands may be claimed as the property of others. All products, dates, and figures are preliminary and are subject to change without any Auto-vectorization 1/ • ::Mask cannot be translated – hence some source code modifications in declaration/definition…: template<TranslationIdType tid, RotationIdType rid, class TubeType=TubeTraits::HollowTubeWithPhi, class T=double> … template<typename VectorType = Vc::Vector<T> > inline __attribute__((always_inline)) typename VectorType::Mask determineRHit( VectorType const & /*x-vec*/, VectorType const & /*y-vec*/, … inline __attribute__((always_inline)) int determineRHitav( T const & /*x-vec*/, T const & /*y- vec*/, T const & /*z-vec*/,
11
Embed
INTEL CONFIDENTIAL Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
• Not a small kernel; but code is quite easily portable to auto-vectorization:‒ MaskType inz_m = safez > Utils::fgToleranceVc;‒ done_m = !inz_m && ( z*dirz >= Vc::Zero ); // particle outside the
z-range and moving away‒ …‒ int inz_m = (safez > Utils::fgTolerance) ? 1 : 0;‒ int done_m = (!inz_m && (z*dirz >= 0.0)) ? 1 : 0; // particle
Auto-vectorization 8/• Auto-vectorization timings are not too catastrophic …~40ms vs 30ms for Vc
(speed-down of 33%)
• No arithmetic perturbation visible !?
• Same behavior for x10 repetitions
• Asm inspection shows partial vectorization for g++ -- need to dig in this direction, as g++ is doing a pretty good job in handling recursive template inlining form out of the box….
• I would recommend to always keep in mind the auto-vectorisation branch in template writing.• Auto-vectorization can be a pain – depending how
compiler handles recursive template inlining..Ours seems to do a very poor job – I will initiate an internal review of this code with compiler engineering.• Need also to review reasons of partial vectorization for
g++• Need to test other kernels more complicated• Try this on Haswell (int will be promoted to 256bits vl)• Try this on MIC• …