On Fri, 2017-07-21 at 23:19 -0500, Aaron Watry wrote:
> Base it on the active language version
> 
> Signed-off-by: Aaron Watry <[email protected]>
> ---
>  src/gallium/state_trackers/clover/llvm/invocation.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp 
> b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index 92d72e5b73..b562babf91 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -202,7 +202,8 @@ namespace {
>        c.getPreprocessorOpts().Includes.push_back("clc/clc.h");
>  
>        // Add definition for the OpenCL version
> -      c.getPreprocessorOpts().addMacroDef("__OPENCL_VERSION__=110");
> +      c.getPreprocessorOpts().addMacroDef("__OPENCL_VERSION__=" +
> +              std::to_string(c.getLangOpts().OpenCLVersion));

similar to previous patch. This should use device OCL version rather
than language version. Moreover, I don't think value of this macro
should be impacted by -cl-std= build parameter.
__OPENCL_C_VERSION__ was added for to fill the gap of both above
behaviours.

Jan

>  
>        // clc.h requires that this macro be defined:
>        
> c.getPreprocessorOpts().addMacroDef("cl_clang_storage_class_specifiers");

-- 
Jan Vesely <[email protected]>

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to