as_complex_double#
Cast an operator to cuda::std::complex<double>
-
template<typename T>
auto __MATX_INLINE__ matx::as_complex_double(const T &t)# Helper function to cast an input operator to a cuda::std::complex<double>
- Template Parameters:
T – Input type
- Parameters:
t – Input operator
- Returns:
Operator output casted to cuda::std::complex<double>
-
template<typename T1, typename T2>
auto __MATX_INLINE__ matx::as_complex_double(const T1 &t1, const T2 &t2)# Helper function to cast an input operator to a cuda::std::complex<double>
- Template Parameters:
T1 – Input type for real components of the complex output type
T2 – Input type for imaginary components of the complex output type
- Parameters:
t1 – Input operator for real components of the complex output type
t2 – Input operator for imaginary components of the complex output type
- Returns:
Operator output casted to cuda::std::complex<double>
Examples#
auto c64 = make_tensor<cuda::std::complex<double>>({});
auto s32 = make_tensor<float>({});
s32.SetVals({3.0f});
(c64 = as_complex_double(s32)).run();
// c64() will be (3.0, 0.0)
auto c64 = make_tensor<cuda::std::complex<double>>({});
auto in_real = make_tensor<TestType>({});
auto in_imag = make_tensor<TestType>({});
in_real.SetVals({3});
in_imag.SetVals({5});
(c64 = as_complex_double(in_real, in_imag)).run(exec);
// c64() will be (3.0, 5.0)