File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,6 +172,23 @@ template <typename T> struct SqrtF {
172172
173173template <typename T> using SqrtOp = UnOp<T, SqrtF<T>>;
174174
175+ template <typename T>
176+ static __MATX_INLINE__ __MATX_HOST__ __MATX_DEVICE__ auto _internal_csqrt (T v1)
177+ {
178+ static_assert (std::is_floating_point_v<T>, " csqrt() only supports non-complex floating point inputs" );
179+ return sqrt (static_cast <cuda::std::complex <T>>(v1));
180+ }
181+
182+ template <typename T> struct CSqrtF {
183+ static __MATX_INLINE__ std::string str () { return " csqrt" ; }
184+ static __MATX_INLINE__ __MATX_HOST__ __MATX_DEVICE__ auto op (T v1)
185+ {
186+ return _internal_csqrt (v1);
187+ }
188+ };
189+
190+
191+ template <typename T> using CsqrtOp = UnOp<T, CSqrtF<T>>;
175192
176193template <typename T>
177194static __MATX_INLINE__ __MATX_HOST__ __MATX_DEVICE__ auto _internal_conj (T v1)
Original file line number Diff line number Diff line change @@ -362,6 +362,7 @@ namespace matx
362362
363363#else
364364 DEFINE_UNARY_OP (sqrt, detail::SqrtOp);
365+ DEFINE_UNARY_OP (csqrt, detail::CsqrtOp);
365366 DEFINE_UNARY_OP (exp, detail::ExpOp);
366367 DEFINE_UNARY_OP (expj, detail::ExpjOp);
367368 DEFINE_UNARY_OP (log10, detail::Log10Op);
You can’t perform that action at this time.
0 commit comments