summaryrefslogtreecommitdiff
path: root/src/utilities.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utilities.hpp')
-rw-r--r--src/utilities.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utilities.hpp b/src/utilities.hpp
index d5efab9f..700d30d6 100644
--- a/src/utilities.hpp
+++ b/src/utilities.hpp
@@ -227,6 +227,12 @@ void FloatToHalfBuffer(std::vector<half>& result, const std::vector<float>& sour
Buffer<float> HalfToFloatBuffer(const Buffer<half>& source, cl_command_queue queue_raw);
void FloatToHalfBuffer(Buffer<half>& result, const Buffer<float>& source, cl_command_queue queue_raw);
+// Converts a 'real' value to a 'real argument' value to be passed to a kernel. Normally there is
+// no conversion, but half-precision is not supported as kernel argument so it is converted to float.
+template <typename T> struct RealArg { using Type = T; };
+template <> struct RealArg<half> { using Type = float; };
+template <typename T> typename RealArg<T>::Type GetRealArg(const T value);
+
// =================================================================================================
// Rounding functions