[Mesa-dev] [PATCH] st/clover: Allow double precision operations

Tom Stellard tom at stellard.net
Fri Jul 12 12:26:08 PDT 2013


On Tue, Jul 02, 2013 at 10:44:37AM +0200, Niels Ole Salscheider wrote:
> Pass "cl_khr_fp64" preprocessor definition to clang
> 

I've gone back and forth a few times on this patch, but I think it is
OK, because all it does is enable the prototypes for builtins that use
the double type.  This is fine, because an application won't be able to
use those functions unless it explicitly enables fp64 support with :

 #pragma OPENCL EXTENSION cl_khr_fp64 : enable

since clang will generate an error if you use doubles types without
enabling the extension.

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>

> Signed-off-by: Niels Ole Salscheider <niels_ole at salscheider-online.de>
> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 1 +
>  1 Datei geändert, 1 Zeile hinzugefügt(+)
> 
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index dae61f7..bc85b61 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -175,6 +175,7 @@ namespace {
>  
>        // clc.h requires that this macro be defined:
>        c.getPreprocessorOpts().addMacroDef("cl_clang_storage_class_specifiers");
> +      c.getPreprocessorOpts().addMacroDef("cl_khr_fp64");
>  
>        c.getLangOpts().NoBuiltin = true;
>        c.getTargetOpts().Triple = triple;
> -- 
> 1.7.11.7
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list