[Beignet] [PATCH V2 2/3] only support spir extension for beignet build with llvm 3.5 or later.

xionghu.luo at intel.com xionghu.luo at intel.com
Fri Mar 13 01:32:40 PDT 2015


From: Luo Xionghu <xionghu.luo at intel.com>

the clang 3.5 will call CallGraphSCCPass to add attribute "Attribute::ReadOnly"
for these parameters only reads memeory, but this attribute is not
supported in the VerifierPass of llvm 3.3. This is a bug of llvm 3.3.

v2: disable this extension in runtime for old llvm.

Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 src/cl_extensions.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/cl_extensions.c b/src/cl_extensions.c
index cea2dd8..adcf82e 100644
--- a/src/cl_extensions.c
+++ b/src/cl_extensions.c
@@ -1,3 +1,4 @@
+#include "llvm/Config/llvm-config.h"
 #ifdef HAS_EGL
 #include "EGL/egl.h"
 #include "EGL/eglext.h"
@@ -37,8 +38,10 @@ void check_opt1_extension(cl_extensions_t *extensions)
   {
     if (id == EXT_ID(khr_icd))
       extensions->extensions[id].base.ext_enabled = 1;
+#if  LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5
     if (id == EXT_ID(khr_spir))
       extensions->extensions[id].base.ext_enabled = 1;
+#endif
   }
 }
 
-- 
1.9.1



More information about the Beignet mailing list