From 391e5757bdfbd37b7d15b6834a90749813a93369 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Tue, 31 Jul 2018 21:44:28 +0200 Subject: Fixed the tests of OMATCOPY to include proper complex conjugation --- test/test_utilities.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/test_utilities.cpp') diff --git a/test/test_utilities.cpp b/test/test_utilities.cpp index 59ec949d..c43200b9 100644 --- a/test/test_utilities.cpp +++ b/test/test_utilities.cpp @@ -31,6 +31,16 @@ template <> bool IsCloseToZero(const double2 value) { return IsCloseToZero(value // ================================================================================================= +// Performs a complex conjugate if complex +template T ComplexConjugate(const T value) { return value; } +template half ComplexConjugate(const half); +template float ComplexConjugate(const float); +template double ComplexConjugate(const double); +template <> float2 ComplexConjugate(const float2 value) { return float2{value.real(), -value.imag()}; } +template <> double2 ComplexConjugate(const double2 value) { return double2{value.real(), -value.imag()}; } + +// ================================================================================================= + template void DeviceToHost(const Arguments &args, Buffers &buffers, BuffersHost &buffers_host, Queue &queue, const std::vector &names) { -- cgit v1.2.3