aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/array_cwise.cpp
diff options
context:
space:
mode:
authorGravatar Antonio Sanchez <cantonios@google.com>2021-01-06 09:41:15 -0800
committerGravatar Antonio Sánchez <cantonios@google.com>2021-01-22 18:19:19 +0000
commitf19bcffee6b8018ca101ceb370e6e550a940289f (patch)
tree36447572f9f35914470c66811e613c20bc4e044e /test/array_cwise.cpp
parent65e2169c4521660d30f4d90df61da5f3dd9f45bd (diff)
Specialize std::complex operators for use on GPU device.
NVCC and older versions of clang do not fully support `std::complex` on device, leading to either compile errors (Cannot call `__host__` function) or worse, runtime errors (Illegal instruction). For most functions, we can implement specialized `numext` versions. Here we specialize the standard operators (with the exception of stream operators and member function operators with a scalar that are already specialized in `<complex>`) so they can be used in device code as well. To import these operators into the current scope, use `EIGEN_USING_STD_COMPLEX_OPERATORS`. By default, these are imported into the `Eigen`, `Eigen:internal`, and `Eigen::numext` namespaces. This allow us to remove specializations of the sum/difference/product/quotient ops, and allow us to treat complex numbers like most other scalars (e.g. in tests).
Diffstat (limited to 'test/array_cwise.cpp')
0 files changed, 0 insertions, 0 deletions