[PATCH 1/2] frexp: Reuse types provided by gentype.inc

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
---
generic/lib/math/frexp.cl | 14 ++++++---
generic/lib/math/frexp.inc | 75 +++++++++++++++++++---------------------------
2 files changed, 40 insertions(+), 49 deletions(-)

diff --git a/generic/lib/math/frexp.cl b/generic/lib/math/frexp.cl
index acd5d93..b331ff8 100644
--- a/generic/lib/math/frexp.cl
+++ b/generic/lib/math/frexp.cl
@@ -1,10 +1,16 @@
#include <clc/clc.h>

-#include "math.h"
+#define __CLC_BODY <frexp.inc>
+#define __CLC_ADDRESS_SPACE private
+#include <clc/math/gentype.inc>
+#undef __CLC_ADDRESS_SPACE

-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-#endif

Pretty sure we need to keep this hunk at the top of the file,
otherwise the double variants fail to compile for me.

--Aaron

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
---
generic/lib/math/frexp.cl | 14 ++++++---
generic/lib/math/frexp.inc | 75 +++++++++++++++++++---------------------------
2 files changed, 40 insertions(+), 49 deletions(-)

diff --git a/generic/lib/math/frexp.cl b/generic/lib/math/frexp.cl
index acd5d93..b331ff8 100644
--- a/generic/lib/math/frexp.cl
+++ b/generic/lib/math/frexp.cl
@@ -1,10 +1,16 @@
#include <clc/clc.h>

-#include "math.h"
+#define __CLC_BODY <frexp.inc>
+#define __CLC_ADDRESS_SPACE private
+#include <clc/math/gentype.inc>
+#undef __CLC_ADDRESS_SPACE

-#ifdef cl_khr_fp64
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable
-#endif

Pretty sure we need to keep this hunk at the top of the file,
otherwise the double variants fail to compile for me.

Otherwise, this looks ok to me. No changes in CTS pass/fail rate.
We've got a failure in double, but that was there before this patch
for the same input value.

--Aaron

> > Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
> > ---
> > generic/lib/math/frexp.cl | 14 ++++++---
> > generic/lib/math/frexp.inc | 75 +++++++++++++++++++---------------------------
> > 2 files changed, 40 insertions(+), 49 deletions(-)
> >
> > diff --git a/generic/lib/math/frexp.cl b/generic/lib/math/frexp.cl
> > index acd5d93..b331ff8 100644
> > --- a/generic/lib/math/frexp.cl
> > +++ b/generic/lib/math/frexp.cl
> > @@ -1,10 +1,16 @@
> > #include <clc/clc.h>
> >
> > -#include "math.h"
> > +#define __CLC_BODY <frexp.inc>
> > +#define __CLC_ADDRESS_SPACE private
> > +#include <clc/math/gentype.inc>
> > +#undef __CLC_ADDRESS_SPACE
> >
> > -#ifdef cl_khr_fp64
> > -#pragma OPENCL EXTENSION cl_khr_fp64 : enable
> > -#endif
>
> Pretty sure we need to keep this hunk at the top of the file,
> otherwise the double variants fail to compile for me.
>

Otherwise, this looks ok to me. No changes in CTS pass/fail rate.
We've got a failure in double, but that was there before this patch
for the same input value.

thanks. It was a part of clean series in preparation for cl_khr_fp16
builtins that, among other things, moved extension enablement to
gentype.inc files.
I'll repost both patches (this and lgamma) as part of the series.

Jan