From c25db2f9da265ef9caa59215c34a0c602205451c Mon Sep 17 00:00:00 2001 From: Aaron Watry Date: Wed, 20 Mar 2013 17:49:30 -0500 Subject: libclc: Move max builtin to shared/ Max(x,y) is available for all integer/floating types. --- generic/include/clc/clc.h | 3 +-- generic/include/clc/integer/max.h | 2 -- generic/include/clc/integer/max.inc | 1 - generic/include/clc/math/max.h | 2 -- generic/include/clc/math/max.inc | 1 - generic/include/clc/shared/max.h | 5 +++++ generic/include/clc/shared/max.inc | 1 + generic/lib/SOURCES | 3 +-- generic/lib/integer/max.cl | 4 ---- generic/lib/integer/max.inc | 3 --- generic/lib/math/max.cl | 8 -------- generic/lib/math/max.inc | 3 --- generic/lib/shared/max.cl | 11 +++++++++++ generic/lib/shared/max.inc | 3 +++ 14 files changed, 22 insertions(+), 28 deletions(-) delete mode 100644 generic/include/clc/integer/max.h delete mode 100644 generic/include/clc/integer/max.inc delete mode 100644 generic/include/clc/math/max.h delete mode 100644 generic/include/clc/math/max.inc create mode 100644 generic/include/clc/shared/max.h create mode 100644 generic/include/clc/shared/max.inc delete mode 100644 generic/lib/integer/max.cl delete mode 100644 generic/lib/integer/max.inc delete mode 100644 generic/lib/math/max.cl delete mode 100644 generic/lib/math/max.inc create mode 100644 generic/lib/shared/max.cl create mode 100644 generic/lib/shared/max.inc diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h index 80ecd01..c3d7d59 100644 --- a/generic/include/clc/clc.h +++ b/generic/include/clc/clc.h @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -64,11 +63,11 @@ #include #include #include -#include #include /* 6.11.2 and 6.11.3 Shared Integer/Math Functions */ #include +#include /* 6.11.5 Geometric Functions */ #include diff --git a/generic/include/clc/integer/max.h b/generic/include/clc/integer/max.h deleted file mode 100644 index e74a459..0000000 --- a/generic/include/clc/integer/max.h +++ /dev/null @@ -1,2 +0,0 @@ -#define BODY -#include diff --git a/generic/include/clc/integer/max.inc b/generic/include/clc/integer/max.inc deleted file mode 100644 index ce6c6d0..0000000 --- a/generic/include/clc/integer/max.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL GENTYPE max(GENTYPE a, GENTYPE b); diff --git a/generic/include/clc/math/max.h b/generic/include/clc/math/max.h deleted file mode 100644 index 3d158f1..0000000 --- a/generic/include/clc/math/max.h +++ /dev/null @@ -1,2 +0,0 @@ -#define BODY -#include diff --git a/generic/include/clc/math/max.inc b/generic/include/clc/math/max.inc deleted file mode 100644 index ce6c6d0..0000000 --- a/generic/include/clc/math/max.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL GENTYPE max(GENTYPE a, GENTYPE b); diff --git a/generic/include/clc/shared/max.h b/generic/include/clc/shared/max.h new file mode 100644 index 0000000..7967d4a --- /dev/null +++ b/generic/include/clc/shared/max.h @@ -0,0 +1,5 @@ +#define BODY +#include + +#define BODY +#include diff --git a/generic/include/clc/shared/max.inc b/generic/include/clc/shared/max.inc new file mode 100644 index 0000000..ce6c6d0 --- /dev/null +++ b/generic/include/clc/shared/max.inc @@ -0,0 +1 @@ +_CLC_OVERLOAD _CLC_DECL GENTYPE max(GENTYPE a, GENTYPE b); diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES index 0d477ba..f639c83 100644 --- a/generic/lib/SOURCES +++ b/generic/lib/SOURCES @@ -8,7 +8,6 @@ integer/abs_diff.cl integer/add_sat.cl integer/add_sat.ll integer/add_sat_impl.ll -integer/max.cl integer/sub_sat.cl integer/sub_sat.ll integer/sub_sat_impl.ll @@ -16,8 +15,8 @@ math/fmax.cl math/fmin.cl math/hypot.cl math/mad.cl -math/max.cl relational/any.cl shared/clamp.cl +shared/max.cl workitem/get_global_id.cl workitem/get_global_size.cl diff --git a/generic/lib/integer/max.cl b/generic/lib/integer/max.cl deleted file mode 100644 index 89fec7c..0000000 --- a/generic/lib/integer/max.cl +++ /dev/null @@ -1,4 +0,0 @@ -#include - -#define BODY -#include diff --git a/generic/lib/integer/max.inc b/generic/lib/integer/max.inc deleted file mode 100644 index 37409fc..0000000 --- a/generic/lib/integer/max.inc +++ /dev/null @@ -1,3 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF GENTYPE max(GENTYPE a, GENTYPE b) { - return (a > b ? a : b); -} diff --git a/generic/lib/math/max.cl b/generic/lib/math/max.cl deleted file mode 100644 index d1254a7..0000000 --- a/generic/lib/math/max.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define BODY -#include diff --git a/generic/lib/math/max.inc b/generic/lib/math/max.inc deleted file mode 100644 index 37409fc..0000000 --- a/generic/lib/math/max.inc +++ /dev/null @@ -1,3 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF GENTYPE max(GENTYPE a, GENTYPE b) { - return (a > b ? a : b); -} diff --git a/generic/lib/shared/max.cl b/generic/lib/shared/max.cl new file mode 100644 index 0000000..5a48537 --- /dev/null +++ b/generic/lib/shared/max.cl @@ -0,0 +1,11 @@ +#include + +#define BODY +#include + +#ifdef cl_khr_fp64 +#pragma OPENCL EXTENSION cl_khr_fp64 : enable +#endif + +#define BODY +#include diff --git a/generic/lib/shared/max.inc b/generic/lib/shared/max.inc new file mode 100644 index 0000000..37409fc --- /dev/null +++ b/generic/lib/shared/max.inc @@ -0,0 +1,3 @@ +_CLC_OVERLOAD _CLC_DEF GENTYPE max(GENTYPE a, GENTYPE b) { + return (a > b ? a : b); +} -- cgit v1.2.3