mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Add device only impl
Add function for device only impl Fix function signatures Fix arrays Add basic test for compilation Allow serial implementation to be run on host under NVCC Add verification steps Add arrays of levels coefficient sizes Cleanup test set Add double test set Add structure for the doubles support Save space by using pointer to different size arrays rather than 2d Separate the double precision weights into their own arrays Remove stray call to std::abs Add NVRTC testing Add documentation section Add device function signature for sinh_sinh_integrate Add float coefficients Add double coeffs Add device specific impl Add sinh_sinh CUDA testing Add sinh_sinh NVRTC testing
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
[/
|
||||
Copyright (c) 2017 Nick Thompson
|
||||
Copyright (c) 2024 Matt Borland
|
||||
Use, modification and distribution are subject to the
|
||||
Boost Software License, Version 1.0. (See accompanying file
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -538,6 +539,30 @@ This form integrates just fine over (-log([pi]/2), +[infin]) using either the `t
|
||||
|
||||
[endsect] [/section:de_caveats Caveats]
|
||||
|
||||
[section:gpu_usage GPU Usage]
|
||||
|
||||
``
|
||||
#include <boost/math/quadrature/exp_sinh.hpp>
|
||||
|
||||
namespace boost{ namespace math{ namespace quadrature {
|
||||
|
||||
template <class F, class Real, class Policy = policies::policy<> >
|
||||
__device__ auto exp_sinh_integrate(const F& f, Real a, Real b, Real tolerance, Real* error, Real* L1, boost::math::size_t* levels)
|
||||
|
||||
template <class F, class Real, class Policy = policies::policy<> >
|
||||
__device__ auto exp_sinh_integrate(const F& f, Real tolerance, Real* error, Real* L1, boost::math::size_t* levels)
|
||||
|
||||
}}}
|
||||
``
|
||||
|
||||
Quadrature is additionally able to run on CUDA (NVCC and NVRTC) platforms.
|
||||
The major difference is outlined in the above function signatures.
|
||||
When used on device these are free standing functions instead of using OOP like on the host.
|
||||
The tables of abscissas and weights are stored in shared read only memory on the device instead of being initialized when the class is constructed.
|
||||
An example use case would be in the finite elements method computing a stiffness matrix since it would consist of many different functions.
|
||||
|
||||
[endsect] [/section:gpu_usage Usage]
|
||||
|
||||
[section:de_refes References]
|
||||
|
||||
* Hidetosi Takahasi and Masatake Mori, ['Double Exponential Formulas for Numerical Integration] Publ. Res. Inst. Math. Sci., 9 (1974), pp. 721-741.
|
||||
|
||||
Reference in New Issue
Block a user