Skip to content

Commit

Permalink
Further template propagation to fix offload build
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipFackler committed Sep 7, 2023
1 parent 944f95b commit f18a95c
Show file tree
Hide file tree
Showing 20 changed files with 4,556 additions and 1,863 deletions.
6 changes: 3 additions & 3 deletions src/Containers/OhmmsPETE/TinyVectorOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@ struct OTDot<TinyVector<T1, 4>, TinyVector<T2, 4>>
};

/** specialization for real-complex TinyVector */
template<class T1>
struct OTDot<TinyVector<T1, 3>, TinyVector<std::complex<T1>, 3>>
template<class T1, class T2>
struct OTDot<TinyVector<T1, 3>, TinyVector<std::complex<T2>, 3>>
{
using Type_t = T1;
inline static Type_t apply(const TinyVector<T1, 3>& lhs, const TinyVector<std::complex<T1>, 3>& rhs)
inline static Type_t apply(const TinyVector<T1, 3>& lhs, const TinyVector<std::complex<T2>, 3>& rhs)
{
return lhs[0] * rhs[0].real() + lhs[1] * rhs[1].real() + lhs[2] * rhs[2].real();
}
Expand Down
9 changes: 7 additions & 2 deletions src/Numerics/OneDimGridFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@


#include "OneDimGridFactory.h"
#include "Configuration.h"
#include "OhmmsData/AttributeSet.h"
#include "Message/UniformCommunicateError.h"

namespace qmcplusplus
{
std::unique_ptr<OneDimGridFactory::GridType> OneDimGridFactory::createGrid(xmlNodePtr cur)
template <typename T>
std::unique_ptr<typename OneDimGridFactory<T>::GridType> OneDimGridFactory<T>::createGrid(xmlNodePtr cur)
{
std::unique_ptr<GridType> agrid;
RealType ri = 1e-5;
RealType rf = 100.0;
RealType ascale = -1.0e0;
RealType astep = 1.25e-2;
IndexType npts = 1001;
QMCTraits::IndexType npts = 1001;
std::string gridType("log");
std::string gridID("invalid");
OhmmsAttributeSet radAttrib;
Expand Down Expand Up @@ -74,4 +76,7 @@ std::unique_ptr<OneDimGridFactory::GridType> OneDimGridFactory::createGrid(xmlNo
}
return agrid;
}

template struct OneDimGridFactory<double>;
template struct OneDimGridFactory<float>;
} // namespace qmcplusplus
6 changes: 4 additions & 2 deletions src/Numerics/OneDimGridFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@

#ifndef QMCPLUSPLUS_ONEDIMGRIDFACTORY_H
#define QMCPLUSPLUS_ONEDIMGRIDFACTORY_H
#include "Configuration.h"
#include "Numerics/OneDimGridFunctor.h"
#include "Numerics/LibxmlNumericIO.h"

namespace qmcplusplus
{
/** Factory class using Singleton pattern
*/
struct OneDimGridFactory : public QMCTraits
template <typename T>
struct OneDimGridFactory
{
using RealType = T;
///typedef of the one-dimensional grid
using GridType = OneDimGridBase<RealType>;

Expand Down
2 changes: 1 addition & 1 deletion src/Numerics/SoaCartesianTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace qmcplusplus
template<class T>
struct SoaCartesianTensor
{
using value_type = T;
using ValueType = T;
using ggg_type = TinyVector<Tensor<T, 3>, 3>;

///maximum angular momentum
Expand Down
2 changes: 2 additions & 0 deletions src/Numerics/SoaSphericalTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ namespace qmcplusplus
template<typename T>
struct SoaSphericalTensor
{
using ValueType = T;

///maximum angular momentum for the center
int Lmax;
/// Normalization factors
Expand Down
20 changes: 12 additions & 8 deletions src/QMCWaveFunctions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ set(WFBASE_SRCS
HarmonicOscillator/SHOSetBuilder.cpp
HarmonicOscillator/SHOSetBuilderT.cpp
ExampleHeBuilder.cpp
ExampleHeComponent.cpp)
ExampleHeComponent.cpp
RotatedSPOsT.cpp)

if(NOT QMC_COMPLEX)
set(WFBASE_SRCS ${WFBASE_SRCS} RotatedSPOs.cpp RotatedSPOsT.cpp)
set(WFBASE_SRCS ${WFBASE_SRCS} RotatedSPOs.cpp)
endif(NOT QMC_COMPLEX)

if(QMC_COMPLEX)
Expand Down Expand Up @@ -85,18 +86,21 @@ if(OHMMS_DIM MATCHES 3)
LCAO/LCAOrbitalBuilderT.cpp
LCAO/MultiQuinticSpline1D.cpp
LCAO/AOBasisBuilder.cpp
LCAO/SoaLocalizedBasisSet.cpp)
LCAO/AOBasisBuilderT.cpp
LCAO/SoaLocalizedBasisSet.cpp
LCAO/SoaLocalizedBasisSetT.cpp
LCAO/LCAOSpinorBuilderT.cpp
LCAO/LCAOrbitalSetWithCorrectionT.cpp
LCAO/CuspCorrectionConstructionT.cpp
LCAO/SoaCuspCorrectionT.cpp)
if(QMC_COMPLEX)
set(FERMION_SRCS ${FERMION_SRCS} LCAO/LCAOSpinorBuilder.cpp LCAO/LCAOSpinorBuilder.cpp)
set(FERMION_SRCS ${FERMION_SRCS} LCAO/LCAOSpinorBuilder.cpp)
else(QMC_COMPLEX)
#LCAO cusp correction is not ready for complex
set(FERMION_SRCS ${FERMION_SRCS}
LCAO/LCAOrbitalSetWithCorrection.cpp
LCAO/LCAOrbitalSetWithCorrectionT.cpp
LCAO/CuspCorrectionConstruction.cpp
LCAO/CuspCorrectionConstructionT.cpp
LCAO/SoaCuspCorrection.cpp
LCAO/SoaCuspCorrectionT.cpp)
LCAO/SoaCuspCorrection.cpp)
endif(QMC_COMPLEX)

if(HAVE_EINSPLINE)
Expand Down
Loading

0 comments on commit f18a95c

Please sign in to comment.