[Libclc-dev] [PATCH 3/4] Do not include clc_nextafter header globally

Jeroen Ketema via Libclc-dev libclc-dev at lists.llvm.org
Sun Oct 8 03:22:44 PDT 2017



> On 8 Oct 2017, at 10:55, Jan Vesely via Libclc-dev <libclc-dev at lists.llvm.org> wrote:
> 
> Drop unused clc/math/clc_nextafter.h header
> 
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
> amdgpu/lib/math/nextafter.cl             |  1 +
> generic/include/clc/clc.h                |  5 -----
> generic/include/clc/math/clc_nextafter.h | 11 -----------
> generic/include/clc/math/gentype.inc     |  2 ++
> 4 files changed, 3 insertions(+), 16 deletions(-)
> delete mode 100644 generic/include/clc/math/clc_nextafter.h
> 
> diff --git a/amdgpu/lib/math/nextafter.cl b/amdgpu/lib/math/nextafter.cl
> index 6aee0a0..5b4521d 100644
> --- a/amdgpu/lib/math/nextafter.cl
> +++ b/amdgpu/lib/math/nextafter.cl
> @@ -1,5 +1,6 @@
> #include <clc/clc.h>
> #include "../lib/clcmacro.h"
> +#include <math/clc_nextafter.h>
> 
> _CLC_DEFINE_BINARY_BUILTIN(float, nextafter, __clc_nextafter, float, float)
> 
> diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
> index adaab90..3701336 100644
> --- a/generic/include/clc/clc.h
> +++ b/generic/include/clc/clc.h
> @@ -264,9 +264,4 @@
> #include <clc/image/image_defines.h>
> #include <clc/image/image.h>
> 
> -/* libclc internal defintions */
> -#ifdef __CLC_INTERNAL
> -#include <math/clc_nextafter.h>
> -#endif
> -
> #pragma OPENCL EXTENSION all : disable
> diff --git a/generic/include/clc/math/clc_nextafter.h b/generic/include/clc/math/clc_nextafter.h
> deleted file mode 100644
> index 81c8f36..0000000
> --- a/generic/include/clc/math/clc_nextafter.h
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -#define __CLC_BODY <clc/math/binary_decl.inc>
> -
> -#define __CLC_FUNCTION nextafter
> -#include <clc/math/gentype.inc>
> -#undef __CLC_FUNCTION
> -
> -#define __CLC_FUNCTION __clc_nextafter
> -#include <clc/math/gentype.inc>
> -#undef __CLC_FUNCTION
> -
> -#undef __CLC_BODY
> diff --git a/generic/include/clc/math/gentype.inc b/generic/include/clc/math/gentype.inc
> index e6ffad1..954cd00 100644
> --- a/generic/include/clc/math/gentype.inc
> +++ b/generic/include/clc/math/gentype.inc
> @@ -54,6 +54,8 @@
> 
> #ifndef __FLOAT_ONLY
> #ifdef cl_khr_fp64
> +#pragma OPENCL EXTENSION cl_khr_fp64 : enable
> +
> #define __CLC_SCALAR_GENTYPE double
> #define __CLC_FPSIZE 64

I this this pragma being enabled in the header files in other places. I’m somewhat
confused: why is this necessary? Why shouldn’t this only occur in the source files
that implement fp64 functionality?

Jeroen

> 
> -- 
> 2.13.6
> 
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev



More information about the Libclc-dev mailing list