A functor to handle lennard-jones interactions between two particles (molecules) This functor uses the SIMD abstraction library Google Highway to provide architecture independent vectorization. More...
#include <LJFunctorHWY.h>


Public Member Functions | |
| LJFunctorHWY ()=delete | |
| Deleted default constructor. | |
| LJFunctorHWY (double cutoff, std::optional< std::reference_wrapper< ParticlePropertiesLibrary< double, size_t > > > particlePropertiesLibrary=std::nullopt) | |
| Constructor for Functor with mixing enabled/disabled. | |
| std::string | getName () final |
| Returns name of functor. | |
| bool | isRelevantForTuning () final |
| Specifies whether the functor should be considered for the auto-tuning process. | |
| bool | allowsNewton3 () final |
| Specifies whether the functor is capable of Newton3-like functors. | |
| bool | allowsNonNewton3 () final |
| Specifies whether the functor is capable of non-Newton3-like functors. | |
| bool | isVecPatternAllowed (const VectorizationPattern vecPattern) final |
| Specifies whether the functor is capable of using the specified Vectorization Pattern in the SoA functor. | |
| void | AoSFunctor (Particle_T &i, Particle_T &j, bool newton3) final |
| PairwiseFunctor for arrays of structures (AoS). | |
| void | SoAFunctorSingle (autopas::SoAView< SoAArraysType > soa, const bool newton3) final |
| PairwiseFunctor for structure of arrays (SoA) | |
| void | SoAFunctorPair (autopas::SoAView< SoAArraysType > soa1, autopas::SoAView< SoAArraysType > soa2, bool newton3) final |
| PairwiseFunctor for structure of arrays (SoA) | |
| void | SoAFunctorPairSorted (autopas::SoAView< SoAArraysType > soa1, autopas::SoAView< SoAArraysType > soa2, const autopas::SoASortingData &sortingData, bool newton3) final |
| SoAFunctorPair on pre-sorted, pre-packed SoA views. | |
| void | SoAFunctorVerlet (autopas::SoAView< SoAArraysType > soa, const size_t indexFirst, const std::vector< size_t, autopas::AlignedAllocator< size_t > > &neighborList, bool newton3) final |
| PairwiseFunctor for structure of arrays (SoA) for neighbor lists. | |
| void | initTraversal () final |
| Reset the global values. | |
| void | endTraversal (const bool newton3) final |
| Accumulates global values, e.g. | |
| double | getPotentialEnergy () const |
| Get the potential Energy. | |
| double | getVirial () const |
| Get the virial. | |
| void | setParticleProperties (const double epsilon24, const double sigmaSquare) |
| Sets the particle properties constants for this functor. | |
| void | setVecPattern (const VectorizationPattern vecPattern) final |
| Setter for the vectorization pattern to be used. | |
Public Member Functions inherited from autopas::PairwiseFunctor< Particle_T, CRTP_T > | |
| PairwiseFunctor (double cutoff) | |
| Constructor. | |
| virtual void | AoSFunctor (Particle_T &i, Particle_T &j, bool newton3) |
| PairwiseFunctor for arrays of structures (AoS). | |
| virtual void | SoAFunctorSingle (SoAView< SoAArraysType > soa, bool newton3) |
| PairwiseFunctor for structure of arrays (SoA) | |
| virtual void | SoAFunctorVerlet (SoAView< SoAArraysType > soa, const size_t indexFirst, const std::vector< size_t, AlignedAllocator< size_t > > &neighborList, bool newton3) |
| PairwiseFunctor for structure of arrays (SoA) for neighbor lists. | |
| virtual void | SoAFunctorPair (SoAView< SoAArraysType > soa1, SoAView< SoAArraysType > soa2, bool newton3) |
| PairwiseFunctor for structure of arrays (SoA) | |
| virtual void | SoAFunctorPairSorted (SoAView< SoAArraysType > soa1, SoAView< SoAArraysType > soa2, const SoASortingData &sortingData, bool newton3) |
| SoAFunctorPair on pre-sorted, pre-packed SoA views. | |
| bool | isVecPatternAllowed (const VectorizationPatternOption::Value vecPattern) override |
| Specifies whether the functor is capable of using the specified Vectorization Pattern in the SoA functor. | |
Public Member Functions inherited from autopas::Functor< Particle_T, CRTP_T > | |
| Functor (double cutoff) | |
| Constructor. | |
| virtual void | initTraversal () |
| This function is called at the start of each traversal. | |
| virtual void | endTraversal (bool newton3) |
| This function is called at the end of each traversal. | |
| template<class ParticleCell > | |
| void | SoALoader (ParticleCell &cell, SoA< SoAArraysType > &soa, size_t offset, bool skipSoAResize) |
| Copies the AoS data of the given cell in the given soa. | |
| template<typename ParticleCell > | |
| void | SoAExtractor (ParticleCell &cell, SoA< SoAArraysType > &soa, size_t offset) |
| Copies the data stored in the soa back into the cell. | |
| virtual bool | allowsNewton3 ()=0 |
| Specifies whether the functor is capable of Newton3-like functors. | |
| virtual bool | allowsNonNewton3 ()=0 |
| Specifies whether the functor is capable of non-Newton3-like functors. | |
| virtual bool | isVecPatternAllowed (const VectorizationPatternOption::Value vecPattern)=0 |
| Specifies whether the functor is capable of using the specified Vectorization Pattern in the SoA functor. | |
| virtual bool | isRelevantForTuning ()=0 |
| Specifies whether the functor should be considered for the auto-tuning process. | |
| virtual std::string | getName ()=0 |
| Returns name of functor. | |
| double | getCutoff () const |
| Getter for the functor's cutoff. | |
| virtual void | setVecPattern (const VectorizationPatternOption::Value vecPattern) |
| Setter for the vectorization pattern to be used. | |
| virtual size_t | getNumFLOPs () const |
| Get the number of FLOPs. | |
| virtual double | getHitRate () const |
| Get the hit rate. | |
Static Public Member Functions | |
| static constexpr auto | getNeededAttr () |
| Get attributes needed for computation. | |
| static constexpr auto | getNeededAttr (std::false_type) |
| Get attributes needed for computation without N3 optimization. | |
| static constexpr auto | getComputedAttr () |
| Get attributes computed by this functor. | |
| static constexpr bool | getMixing () |
Static Public Member Functions inherited from autopas::Functor< Particle_T, CRTP_T > | |
| static constexpr std::array< typename Particle_T::AttributeNames, 0 > | getNeededAttr () |
| Get attributes needed for computation. | |
| static constexpr std::array< typename Particle_T::AttributeNames, 0 > | getNeededAttr (std::false_type) |
| Get attributes needed for computation without N3 optimization. | |
| static constexpr std::array< typename Particle_T::AttributeNames, 0 > | getComputedAttr () |
| Get attributes computed by this functor. | |
Static Public Attributes | |
| static constexpr bool | supportsSoASorting = true |
| Whether this functor supports the SortedSoAView optimization path (SoAFunctorPairSorted). | |
Static Public Attributes inherited from autopas::Functor< Particle_T, CRTP_T > | |
| static constexpr bool | supportsSoASorting = false |
| Whether this functor supports the SortedSoAView optimization path (SoAFunctorPairSorted). | |
Additional Inherited Members | |
Public Types inherited from autopas::PairwiseFunctor< Particle_T, CRTP_T > | |
| using | SoAArraysType = typename Particle_T::SoAArraysType |
| Structure of the SoAs defined by the particle. | |
Public Types inherited from autopas::Functor< Particle_T, CRTP_T > | |
| using | SoAArraysType = typename Particle_T::SoAArraysType |
| Structure of the SoAs defined by the particle. | |
| using | Functor_T = CRTP_T |
| Make the Implementation type template publicly available. | |
A functor to handle lennard-jones interactions between two particles (molecules) This functor uses the SIMD abstraction library Google Highway to provide architecture independent vectorization.
| Particle_T | The type of particle |
| applyShift | Switch for the lj potential to be truncated shifted |
| useMixing | Switch for the functor to be used with multiple particle types. If set to false, _epsilon and _sigma need to be set and the constructor with PPL can be omitted. |
| useNewton3 | Switch for the functor to support newton3 on, off or both. See FunctorN3Modes for possible values. |
| calculateGlobals | Defines whether the global values are to be calculated (energy, virial). |
| relevantForTuning | Whether the auto-tuner should consider this functor. |
| countFLOPs | counts FLOPs and hitrate. Not implemented for this functor. Please use the AutoVec functor. |
|
inlineexplicit |
Constructor for Functor with mixing enabled/disabled.
When using this functor without particlePropertiesLibrary it is necessary to call setParticleProperties() to set internal constants.
| cutoff | |
| particlePropertiesLibrary |
|
inlinefinalvirtual |
Specifies whether the functor is capable of Newton3-like functors.
If the functor provides an interface to soa or aos functions that utilize Newton's third law of motion (actio = reactio) to reduce the computational complexity this function should return true. If this is not the case this function should return false.
Implements autopas::Functor< Particle_T, CRTP_T >.
|
inlinefinalvirtual |
Specifies whether the functor is capable of non-Newton3-like functors.
If the functor provides an interface to soa or aos functions that do not utilize Newton's third law of motion (actio = reactio) this function should return true. If this is not the case this function should return false.
Implements autopas::Functor< Particle_T, CRTP_T >.
|
inlinefinalvirtual |
PairwiseFunctor for arrays of structures (AoS).
This functor should calculate the forces or any other pair-wise interaction between two particles. This should include a cutoff check if needed!
| i | Particle i |
| j | Particle j |
| newton3 | defines whether or whether not to use newton 3 |
Reimplemented from autopas::PairwiseFunctor< Particle_T, CRTP_T >.
|
inlinefinalvirtual |
Accumulates global values, e.g.
upot and virial.
| newton3 |
Reimplemented from autopas::Functor< Particle_T, CRTP_T >.
|
inlinestaticconstexpr |
Get attributes computed by this functor.
|
inlinestaticconstexpr |
|
inlinefinalvirtual |
Returns name of functor.
Intended for use with the iteration logger, to differentiate between calls to computeInteractions using different functors in the logs.
Implements autopas::Functor< Particle_T, CRTP_T >.
|
inlinestaticconstexpr |
Get attributes needed for computation.
|
inlinestaticconstexpr |
Get attributes needed for computation without N3 optimization.
|
inline |
Get the potential Energy.
|
inline |
Get the virial.
|
inlinefinalvirtual |
Reset the global values.
Will set the global values to zero to prepare for the next iteration.
Reimplemented from autopas::Functor< Particle_T, CRTP_T >.
|
inlinefinalvirtual |
Specifies whether the functor should be considered for the auto-tuning process.
Implements autopas::Functor< Particle_T, CRTP_T >.
|
inlinefinal |
Specifies whether the functor is capable of using the specified Vectorization Pattern in the SoA functor.
This functor can handle p1xVec, p2xVecDiv2, pVecDiv2x2, pVecx1
| vecPattern |
|
inline |
Sets the particle properties constants for this functor.
This is only necessary if no particlePropertiesLibrary is used.
| epsilon24 | |
| sigmaSquare |
|
inlinefinal |
Setter for the vectorization pattern to be used.
| vecPattern |
|
inlinefinalvirtual |
PairwiseFunctor for structure of arrays (SoA)
This functor should calculate the forces or any other pair-wise interaction between all particles of soa1 and soa2. This should include a cutoff check if needed!
| soa1 | First structure of arrays. |
| soa2 | Second structure of arrays. |
| newton3 | defines whether or whether not to use newton 3 |
Reimplemented from autopas::PairwiseFunctor< Particle_T, CRTP_T >.
|
inlinefinalvirtual |
SoAFunctorPair on pre-sorted, pre-packed SoA views.
CellFunctor handles projection, sorting, packing, and computing the index bounds; this function receives contiguous sorted views and only needs to run the kernel.
Must be overridden by functors that set supportsSoASorting=true; the default throws.
| soa1 | Sorted, packed view of cell 1 particles. |
| soa2 | Sorted, packed view of cell 2 particles. |
| sortingData | Precomputed start_i, maxIndex, minIndex for loop-bound pruning. |
| newton3 | Whether to apply Newton's third law. |
Reimplemented from autopas::PairwiseFunctor< Particle_T, CRTP_T >.
|
inlinefinalvirtual |
PairwiseFunctor for structure of arrays (SoA)
This functor should calculate the forces or any other pair-wise interaction between all particles in an soa. This should include a cutoff check if needed!
| soa | Structure of arrays |
| newton3 | defines whether or whether not to use newton 3 This functor will always do a newton3 like traversal of the SoA using only the 1xVec Pattern. |
Reimplemented from autopas::PairwiseFunctor< Particle_T, CRTP_T >.
|
inlinefinalvirtual |
PairwiseFunctor for structure of arrays (SoA) for neighbor lists.
This functor should calculate the forces or any other pair-wise interaction between the particle in the SoA with index indexFirst and all particles with indices in the neighborList. This should include a cutoff check if needed!
| soa | Structure of arrays |
| indexFirst | The index of the first particle for each interaction |
| neighborList | The list of neighbors |
| newton3 | defines whether or whether not to use newton 3 |
Reimplemented from autopas::PairwiseFunctor< Particle_T, CRTP_T >.
|
staticconstexpr |
Whether this functor supports the SortedSoAView optimization path (SoAFunctorPairSorted).
Derived functors that set this to true must also:
+=. Non-numeric attributes cannot be accumulated this way.+=. Attributes whose correct update requires assignment (e.g. =) rather than accumulation must not appear in getComputedAttr().