QMCPACK
createBsplineComplex.cpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by:
8 //
9 // File created by: Jeongnim Kim, jeongnim.kim@intel.com, Intel Corp.
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
14 #include <PlatformSelector.hpp>
15 #include "SplineSetReader.h"
16 #include "HybridRepSetReader.h"
17 
18 namespace qmcplusplus
19 {
20 /** create a reader which handles complex (double size real) splines, C2R or C2C case
21  * spline storage and computation precision is ST
22  */
23 template<typename ST>
24 std::unique_ptr<BsplineReader> createBsplineComplex(EinsplineSetBuilder* e, bool hybrid_rep, const std::string& useGPU)
25 {
26  using RealType = OHMMS_PRECISION;
27  std::unique_ptr<BsplineReader> aReader;
28 
29 #if defined(QMC_COMPLEX)
30  app_summary() << " Using complex valued spline SPOs with complex " << SplineStoragePrecision<ST>::value
31  << " precision storage (C2C)." << std::endl;
33  {
34  app_summary() << " Running OpenMP offload code path." << std::endl;
35  if (hybrid_rep)
36  {
37  app_summary() << " Using hybrid orbital representation." << std::endl;
38  aReader = std::make_unique<HybridRepSetReader<HybridRepCplx<SplineC2COMPTarget<ST>>>>(e);
39  }
40  else
41  aReader = std::make_unique<SplineSetReader<SplineC2COMPTarget<ST>>>(e);
42  }
43  else
44  {
45  app_summary() << " Running on CPU." << std::endl;
46  if (hybrid_rep)
47  {
48  app_summary() << " Using hybrid orbital representation." << std::endl;
49  aReader = std::make_unique<HybridRepSetReader<HybridRepCplx<SplineC2C<ST>>>>(e);
50  }
51  else
52  aReader = std::make_unique<SplineSetReader<SplineC2C<ST>>>(e);
53  }
54 #else //QMC_COMPLEX
55  app_summary() << " Using real valued spline SPOs with complex " << SplineStoragePrecision<ST>::value
56  << " precision storage (C2R)." << std::endl;
58  {
59  app_summary() << " Running OpenMP offload code path." << std::endl;
60  if (hybrid_rep)
61  {
62  app_summary() << " Using hybrid orbital representation." << std::endl;
63  aReader = std::make_unique<HybridRepSetReader<HybridRepCplx<SplineC2ROMPTarget<ST>>>>(e);
64  }
65  else
66  aReader = std::make_unique<SplineSetReader<SplineC2ROMPTarget<ST>>>(e);
67  }
68  else
69  {
70  app_summary() << " Running on CPU." << std::endl;
71  if (hybrid_rep)
72  {
73  app_summary() << " Using hybrid orbital representation." << std::endl;
74  aReader = std::make_unique<HybridRepSetReader<HybridRepCplx<SplineC2R<ST>>>>(e);
75  }
76  else
77  aReader = std::make_unique<SplineSetReader<SplineC2R<ST>>>(e);
78  }
79 #endif
80  return aReader;
81 }
82 
83 std::unique_ptr<BsplineReader> createBsplineComplex(EinsplineSetBuilder* e,
84  bool use_single,
85  bool hybrid_rep,
86  const std::string& useGPU)
87 {
88  if (use_single)
89  return createBsplineComplex<float>(e, hybrid_rep, useGPU);
90  else
91  return createBsplineComplex<double>(e, hybrid_rep, useGPU);
92 }
93 
94 } // namespace qmcplusplus
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
#define OHMMS_PRECISION
Definition: config.h:70
std::ostream & app_summary()
Definition: OutputManager.h:63
std::unique_ptr< BsplineReader > createBsplineComplex(EinsplineSetBuilder *e, bool hybrid_rep, const std::string &useGPU)
create a reader which handles complex (double size real) splines, C2R or C2C case spline storage and ...
static PlatformKind selectPlatform(std::string_view value)
The most general reader class for the following classes using the full single grid for the supercell...
derived from BsplineReader