[Libclc-dev] [PATCH] Move mix from math to common

Aaron Watry awatry at gmail.com
Thu Feb 26 08:04:44 PST 2015


It has been part of the common functions since 1.0

Signed-off-by: Aaron Watry <awatry at gmail.com>
---
 generic/include/clc/clc.h          | 2 +-
 generic/include/clc/common/mix.h   | 2 ++
 generic/include/clc/common/mix.inc | 5 +++++
 generic/include/clc/math/mix.h     | 2 --
 generic/include/clc/math/mix.inc   | 5 -----
 generic/lib/SOURCES                | 2 +-
 generic/lib/common/mix.cl          | 8 ++++++++
 generic/lib/common/mix.inc         | 9 +++++++++
 generic/lib/math/mix.cl            | 8 --------
 generic/lib/math/mix.inc           | 9 ---------
 10 files changed, 26 insertions(+), 26 deletions(-)
 create mode 100644 generic/include/clc/common/mix.h
 create mode 100644 generic/include/clc/common/mix.inc
 delete mode 100644 generic/include/clc/math/mix.h
 delete mode 100644 generic/include/clc/math/mix.inc
 create mode 100644 generic/lib/common/mix.cl
 create mode 100644 generic/lib/common/mix.inc
 delete mode 100644 generic/lib/math/mix.cl
 delete mode 100644 generic/lib/math/mix.inc

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 92ef769..ae611a5 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -55,7 +55,6 @@
 #include <clc/math/log1p.h>
 #include <clc/math/log2.h>
 #include <clc/math/mad.h>
-#include <clc/math/mix.h>
 #include <clc/math/nextafter.h>
 #include <clc/math/pow.h>
 #include <clc/math/pown.h>
@@ -110,6 +109,7 @@
 /* 6.11.4 Common Functions */
 #include <clc/common/degrees.h>
 #include <clc/common/radians.h>
+#include <clc/common/mix.h>
 #include <clc/common/sign.h>
 #include <clc/common/smoothstep.h>
 #include <clc/common/step.h>
diff --git a/generic/include/clc/common/mix.h b/generic/include/clc/common/mix.h
new file mode 100644
index 0000000..262861c
--- /dev/null
+++ b/generic/include/clc/common/mix.h
@@ -0,0 +1,2 @@
+#define __CLC_BODY <clc/common/mix.inc>
+#include <clc/math/gentype.inc>
diff --git a/generic/include/clc/common/mix.inc b/generic/include/clc/common/mix.inc
new file mode 100644
index 0000000..52cb10a
--- /dev/null
+++ b/generic/include/clc/common/mix.inc
@@ -0,0 +1,5 @@
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c);
+
+#ifndef __CLC_SCALAR
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_SCALAR_GENTYPE c);
+#endif
diff --git a/generic/include/clc/math/mix.h b/generic/include/clc/math/mix.h
deleted file mode 100644
index c3c95c1..0000000
--- a/generic/include/clc/math/mix.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#define __CLC_BODY <clc/math/mix.inc>
-#include <clc/math/gentype.inc>
diff --git a/generic/include/clc/math/mix.inc b/generic/include/clc/math/mix.inc
deleted file mode 100644
index 52cb10a..0000000
--- a/generic/include/clc/math/mix.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c);
-
-#ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_SCALAR_GENTYPE c);
-#endif
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index f0488ef..8411b8f 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -28,6 +28,7 @@ cl_khr_local_int32_extended_atomics/atom_or.cl
 cl_khr_local_int32_extended_atomics/atom_xor.cl
 convert.cl
 common/degrees.cl
+common/mix.cl
 common/radians.cl
 common/sign.cl
 common/smoothstep.cl
@@ -71,7 +72,6 @@ math/hypot.cl
 math/log10.cl
 math/log1p.cl
 math/mad.cl
-math/mix.cl
 math/tables.cl
 math/clc_nextafter.cl
 math/nextafter.cl
diff --git a/generic/lib/common/mix.cl b/generic/lib/common/mix.cl
new file mode 100644
index 0000000..294f332
--- /dev/null
+++ b/generic/lib/common/mix.cl
@@ -0,0 +1,8 @@
+#include <clc/clc.h>
+
+#ifdef cl_khr_fp64
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+#endif
+
+#define __CLC_BODY <mix.inc>
+#include <clc/math/gentype.inc>
diff --git a/generic/lib/common/mix.inc b/generic/lib/common/mix.inc
new file mode 100644
index 0000000..1e8b936
--- /dev/null
+++ b/generic/lib/common/mix.inc
@@ -0,0 +1,9 @@
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE mix(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE a) {
+  return mad( y - x, a, x );
+}
+
+#ifndef __CLC_SCALAR
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE mix(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_SCALAR_GENTYPE a) {
+    return mix(x, y, (__CLC_GENTYPE)a);
+}
+#endif
diff --git a/generic/lib/math/mix.cl b/generic/lib/math/mix.cl
deleted file mode 100644
index 294f332..0000000
--- a/generic/lib/math/mix.cl
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <clc/clc.h>
-
-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-#endif
-
-#define __CLC_BODY <mix.inc>
-#include <clc/math/gentype.inc>
diff --git a/generic/lib/math/mix.inc b/generic/lib/math/mix.inc
deleted file mode 100644
index 1e8b936..0000000
--- a/generic/lib/math/mix.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE mix(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE a) {
-  return mad( y - x, a, x );
-}
-
-#ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE mix(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_SCALAR_GENTYPE a) {
-    return mix(x, y, (__CLC_GENTYPE)a);
-}
-#endif
-- 
2.1.0





More information about the Libclc-dev mailing list