[Beignet] [PATCH] ocl20: fix the cmake to set correct cl-std version

Yang, Rong R rong.r.yang at intel.com
Wed Dec 23 00:00:05 PST 2015


LGTM, pushed, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Ruiling Song
> Sent: Wednesday, November 18, 2015 15:43
> To: beignet at lists.freedesktop.org
> Cc: Song, Ruiling
> Subject: [Beignet] [PATCH] ocl20: fix the cmake to set correct cl-std version
> 
> modify CLANG_OCL_FLAGS is enough.
> 
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
>  backend/src/libocl/CMakeLists.txt | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/backend/src/libocl/CMakeLists.txt
> b/backend/src/libocl/CMakeLists.txt
> index 038052b..564c1b9 100644
> --- a/backend/src/libocl/CMakeLists.txt
> +++ b/backend/src/libocl/CMakeLists.txt
> @@ -130,7 +130,7 @@ FOREACH(M ${OCL_BASH_GENERATED_MODULES})
>  ENDFOREACH(M)
> 
> 
> -SET (CLANG_OCL_FLAGS -fno-builtin -ffp-contract=off -cl-kernel-arg-info -
> DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND "-cl-std=CL1.2")
> +SET (CLANG_OCL_FLAGS -fno-builtin -ffp-contract=off -cl-kernel-arg-info
> +-DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND "-cl-std=CL2.0")
>  MACRO(ADD_CL_TO_BC_TARGET _file)
>      # CMake seems can not add pattern rule, use MACRO to replace.
>      STRING(REGEX REPLACE "${LIBOCL_BINARY_DIR}/src/\(o.*\)\\.cl"
> "${OCL_OBJECT_DIR}/\\1.bc" output_name ${_file}) @@ -201,14 +201,14
> @@ ADD_CUSTOM_COMMAND(OUTPUT ${OCL_OBJECT_DIR}/beignet.bc
> 
>  ADD_CUSTOM_COMMAND(OUTPUT ${OCL_OBJECT_DIR}/beignet.local.pch
>      COMMAND mkdir -p ${OCL_OBJECT_DIR}
> -    COMMAND ${CLANG_EXECUTABLE} -cc1 ${CLANG_OCL_FLAGS} -triple
> spir64 -I ${OCL_OBJECT_DIR}/include/ -emit-pch -x cl -cl-std=CL2.0
> ${OCL_OBJECT_DIR}/include/ocl.h -o ${OCL_OBJECT_DIR}/beignet.local.pch
> +    COMMAND ${CLANG_EXECUTABLE} -cc1 ${CLANG_OCL_FLAGS} -triple
> spir64
> + -I ${OCL_OBJECT_DIR}/include/ -emit-pch -x cl
> + ${OCL_OBJECT_DIR}/include/ocl.h -o
> ${OCL_OBJECT_DIR}/beignet.local.pch
>      DEPENDS ${OCL_HEADER_FILES}
>      COMMENT "Generate the pch file: ${OCL_OBJECT_DIR}/beignet.local.pch"
>      )
> 
>  ADD_CUSTOM_COMMAND(OUTPUT ${OCL_OBJECT_DIR}/beignet.pch
>      COMMAND mkdir -p ${OCL_OBJECT_DIR}
> -    COMMAND ${CLANG_EXECUTABLE} -cc1 ${CLANG_OCL_FLAGS} -triple
> spir64 -I ${OCL_OBJECT_DIR}/include/ --relocatable-pch -emit-pch -isysroot
> ${LIBOCL_BINARY_DIR} -x cl -cl-std=CL2.0 ${OCL_OBJECT_DIR}/include/ocl.h -
> o ${OCL_OBJECT_DIR}/beignet.pch
> +    COMMAND ${CLANG_EXECUTABLE} -cc1 ${CLANG_OCL_FLAGS} -triple
> spir64
> + -I ${OCL_OBJECT_DIR}/include/ --relocatable-pch -emit-pch -isysroot
> + ${LIBOCL_BINARY_DIR} -x cl ${OCL_OBJECT_DIR}/include/ocl.h -o
> + ${OCL_OBJECT_DIR}/beignet.pch
>      DEPENDS ${OCL_HEADER_FILES}
>      COMMENT "Generate the pch file: ${OCL_OBJECT_DIR}/beignet.pch"
>      )
> --
> 2.4.1
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list