diff --git a/SYCL/Complex/sycl_complex_helper.hpp b/SYCL/Complex/sycl_complex_helper.hpp new file mode 100644 index 0000000000..6c8ec7ff9f --- /dev/null +++ b/SYCL/Complex/sycl_complex_helper.hpp @@ -0,0 +1,203 @@ +#include +#include + +#define SYCL_EXT_ONEAPI_COMPLEX +#include +#include + +using namespace sycl::ext::oneapi; + +#define SYCL_CPLX_TOL_ULP 5 + +#define PI 3.14159265358979323846 + +constexpr double INFINITYd(std::numeric_limits::infinity()); +constexpr double NANd(std::numeric_limits::quiet_NaN()); + +template struct cmplx { + cmplx(T real, T imag) : re(real), im(imag) {} + + template cmplx(cmplx c) { + re = c.re; + im = c.im; + } + + T re; + T im; +}; + +// Helpers for displaying results + +template const char *get_typename() { return "Unknown type"; } +template <> const char *get_typename() { return "double"; } +template <> const char *get_typename() { return "float"; } +template <> const char *get_typename() { return "sycl::half"; } + +// Helper to test each complex specilization +template