5#include <thrust/complex.h>
15template<
class T0,
class T1,
class T2,
class = std::enable_if_t<std::is_
floating_po
int_v<T2> >>
17auto dg_fma( T0 x, T1
y, T2
z)
19 return fma( (T2)x, (T2)
y,
z);
21template<
class T0,
class T,
class = std::enable_if_t<std::is_
floating_po
int_v<T> >>
22std::complex<T> dg_fma( T0 x, std::complex<T>
y, std::complex<T>
z)
25 std::fma( (T)x,
y.real(),
z.real()),
26 std::fma( (T)x,
y.imag(),
z.imag())
29template<
class T,
class = std::enable_if_t<std::is_
floating_po
int_v<T> >>
30std::complex<T> dg_fma( std::complex<T> x, std::complex<T>
y, std::complex<T>
z)
32 std::complex<T> out = {
33 std::fma(
x.real(),
y.real(),
z.real()),
34 std::fma(
x.real(),
y.imag(),
z.imag())
37 std::fma( -
x.imag(),
y.imag(), out.real()),
38 std::fma(
x.imag(),
y.real(), out.imag())
41template<
class T0,
class T,
class = std::enable_if_t<std::is_
floating_po
int_v<T> >>
43thrust::complex<T> dg_fma( T0 x, thrust::complex<T>
y, thrust::complex<T>
z)
46 fma( (T)x,
y.real(),
z.real()),
47 fma( (T)x,
y.imag(),
z.imag())
50template<
class T,
class = std::enable_if_t<std::is_
floating_po
int_v<T> >>
52thrust::complex<T> dg_fma( thrust::complex<T> x, thrust::complex<T>
y, thrust::complex<T>
z)
54 thrust::complex<T> out = {
55 fma(
x.real(),
y.real(),
z.real()),
56 fma(
x.real(),
y.imag(),
z.imag())
59 fma( -
x.imag(),
y.imag(), out.real()),
60 fma(
x.imag(),
y.real(), out.imag())
#define DG_DEVICE
Expands to __host__ __device__ if compiled with nvcc else is empty.
Definition dg_doc.h:378
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...