summaryrefslogtreecommitdiff
path: root/test/test_utilities.cpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2018-07-31 21:44:28 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2018-07-31 21:44:28 +0200
commit391e5757bdfbd37b7d15b6834a90749813a93369 (patch)
treeb0fb245b03523adfaef6c71b307cde9b5026b9b5 /test/test_utilities.cpp
parent713d0f96b3dda04cbd9a2c5da3cb283a2d2719e0 (diff)
Fixed the tests of OMATCOPY to include proper complex conjugation
Diffstat (limited to 'test/test_utilities.cpp')
-rw-r--r--test/test_utilities.cpp10
1 files changed, 10 insertions, 0 deletions
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 <typename T> 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 <typename T, typename U>
void DeviceToHost(const Arguments<U> &args, Buffers<T> &buffers, BuffersHost<T> &buffers_host,
Queue &queue, const std::vector<std::string> &names) {