7#include "BS_thread_pool.hpp"
57 [&](
auto &&...
args) {
return int_element * weight * KERNEL::kernel(q, cos1, cos2, phi,
k,
args...); },
74 const uint maxeval = 100000)
97 integrator.cudathreadsperblock = json.
get_int(
"/integration/cudathreadsperblock");
98 }
catch (
const std::exception &e) {
99 spdlog::get(
"log")->warn(
"Please provide all integrator parameters in the json file. Using default values.");
100 spdlog::get(
"log")->warn(
101 "QMC integrator parameters: minm = 32, minn = 512, cudablocks = 64, cudathreadsperblock = 32");
119 template <
typename... T> NT
get(
const ctype k,
const T &...t)
const
124 const NT constant = KERNEL::constant(k, t...);
139 template <
typename... T> std::future<NT>
request(
const ctype k,
const T &...t)
const
141 const NT constant = KERNEL::constant(k, t...);
143 return pool.submit_task([=,
this]() {
146 return constant + m_integrator.integrate(functor).integral;
151 mutable BS::thread_pool<BS::tp::none>
pool;
Definition integrator_4D_qmc.hh:37
const ctype k
Definition integrator_4D_qmc.hh:63
__host__ __device__ NT operator()(ctype *x) const
Definition integrator_4D_qmc.hh:43
const ctype x_extent
Definition integrator_4D_qmc.hh:62
static constexpr unsigned long long int number_of_integration_variables
Definition integrator_4D_qmc.hh:39
Functor(const ctype x_extent, const ctype k, const Args &...args)
Definition integrator_4D_qmc.hh:41
std::tuple< Args... > args
Definition integrator_4D_qmc.hh:64
GPU integrator for the integration of a 4D function with three angles with quasi-Monte-Carlo....
Definition integrator_4D_qmc.hh:29
NT get(const ctype k, const T &...t) const
Get the integral of the kernel.
Definition integrator_4D_qmc.hh:119
Integrator4DQMC(const ctype x_extent, const JSONValue &json)
Definition integrator_4D_qmc.hh:87
BS::thread_pool< BS::tp::none > pool
Definition integrator_4D_qmc.hh:151
Integrator4DQMC(QuadratureProvider &quadrature_provider, const std::array< uint, 4 > grid_size, const ctype x_extent, const JSONValue &json)
Definition integrator_4D_qmc.hh:67
typename get_type::ctype< NT > ctype
Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
Definition integrator_4D_qmc.hh:34
integrators::Qmc< NT, ctype, 4, integrators::transforms::None::type > integrator
Definition integrator_4D_qmc.hh:152
const ctype x_extent
Definition integrator_4D_qmc.hh:153
std::future< NT > request(const ctype k, const T &...t) const
Request a future for the integral of the kernel.
Definition integrator_4D_qmc.hh:139
Integrator4DQMC(const ctype x_extent, const double rel_tol=1e-3, const double abs_tol=1e-14, const uint maxeval=100000)
Definition integrator_4D_qmc.hh:73
A wrapper around the boost json value class.
Definition json.hh:19
double get_double(const std::string &key) const
Get the value of a key in the json object.
int get_int(const std::string &key) const
Get the value of a key in the json object.
A class that provides quadrature points and weights, in host and device memory. The quadrature points...
Definition quadrature_provider.hh:139
typename internal::_ctype< CT >::value ctype
Definition types.hh:106
Definition complex_math.hh:14
constexpr __forceinline__ __host__ __device__ NumberType powr(const NumberType x)
A compile-time evaluatable power function for whole number exponents.
Definition math.hh:45
unsigned int uint
Definition utils.hh:22
T integral
Definition qmc.hpp:71