[Beignet] iceweasel mangling patches

Zhigang Gong zhigang.gong at linux.intel.com
Wed Apr 29 02:28:09 PDT 2015


This works fine. Thanks.

On Wed, Apr 29, 2015 at 11:26:41AM +0100, Rebecca N. Palmer wrote:
> On 29/04/15 10:11, Zhigang Gong wrote:
> > Actually, almost all the patches you sent out have similar problem and
> > I had manually applied them line by line before. I think it's better to
> > find out the root cause.
> 
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/email-clients.txt
> suggests the problem may be mailnews.send_plaintext_flowed;
> is this any better?
> 
> Make the build scripts work in both Python 2 and Python 3.
> (CMake prefers Python 2 if both are available, but will use
> Python 3 if only it is installed.)
> 
> Signed-off-by: Rebecca Palmer <rebecca_palmer at zoho.com>
> 
> diff --git a/backend/src/libocl/script/gen_vector.py b/backend/src/libocl/script/gen_vector.py
> index ffc573a..92582f5 100755
> --- a/backend/src/libocl/script/gen_vector.py
> +++ b/backend/src/libocl/script/gen_vector.py
> @@ -20,13 +20,14 @@
>  
>  # This file is to generate inline code to lower down those builtin
>  # vector functions to scalar functions.
> +from __future__ import print_function
>  import re
>  import sys
>  import os
>  
>  if len(sys.argv) != 4:
> -    print "Invalid argument {0}".format(sys.argv)
> -    print "use {0} spec_file_name output_file_name just_proto".format(sys.argv[0])
> +    print("Invalid argument {0}".format(sys.argv))
> +    print("use {0} spec_file_name output_file_name just_proto".format(sys.argv[0]))
>      raise
>  
>  all_vector = 1,2,3,4,8,16
> @@ -61,8 +62,8 @@ all_type = all_int_type + all_float_type
>  
>  # all vector/scalar types
>  for t in all_type:
> -    exec "{0}n = [\"{0}n\", gen_vector_type([\"{0}\"])]".format(t)
> -    exec "s{0} = [\"{0}\", gen_vector_type([\"{0}\"], [1])]".format(t)
> +    exec("{0}n = [\"{0}n\", gen_vector_type([\"{0}\"])]".format(t))
> +    exec("s{0} = [\"{0}\", gen_vector_type([\"{0}\"], [1])]".format(t))
>  
>  # Predefined type sets according to the Open CL spec.
>  math_gentype = ["math_gentype", gen_vector_type(all_float_type)]
> @@ -124,8 +125,8 @@ def check_type(types):
>      for t in types:
>          memspace, t = stripMemSpace(t)
>          if not t in type_dict:
> -            print t
> -            raise "found invalid type."
> +            print(t)
> +            raise TypeError("found invalid type.")
>  
>  def match_unsigned(dtype):
>      if dtype[0] == 'float':
> @@ -187,8 +188,8 @@ def fixup_type(dstType, srcType, n):
>          if (len(dstType) == len(srcType)):
>              return dstType[n]
>  
> -    print dstType, srcType
> -    raise "type mispatch"
> +    print(dstType, srcType)
> +    raise TypeError("type mispatch")
>  
>  class builtinProto():
>      valueTypeStr = ""
> @@ -226,7 +227,7 @@ class builtinProto():
>  
>      def init_from_line(self, t):
>          self.append('//{0}'.format(t))
> -        line = filter(None, re.split(',| |\(', t.rstrip(')\n')))
> +        line = [_f for _f in re.split(',| |\(', t.rstrip(')\n')) if _f]
>          self.paramCount = 0
>          stripped = 0
>          memSpace = ''
> @@ -310,7 +311,7 @@ class builtinProto():
>                  vtype = fixup_type(vtypeSeq, ptypeSeqs[n], i)
>                  if vtype[1] != ptype[1]:
>                      if ptype[1] != 1:
> -                        raise "parameter is not a scalar but has different width with result value."
> +                        raise TypeError("parameter is not a scalar but has different width with result value.")
>                      if isPointer(ptype):
>                          formatStr += '&'
>                      formatStr += 'param{0}'.format(n)
> @@ -333,7 +334,7 @@ class builtinProto():
>  
>      def output(self):
>          for line in self.outputStr:
> -            print line
> +            print(line)
>  
>      def output(self, outFile):
>          for line in self.outputStr:
> diff --git a/utests/utest_generator.py b/utests/utest_generator.py
> index 510c41a..7d2d3a0 100644
> --- a/utests/utest_generator.py
> +++ b/utests/utest_generator.py
> @@ -1,4 +1,5 @@
>  #!/usr/bin/python
> +from __future__ import print_function
>  import os,sys,re
>  
>  FLT_MAX_POSI='0x1.fffffep127f'
> @@ -326,7 +327,7 @@ which can print more values and information to assist debuging the issue.
>      file_object.close()
>  
>    def nameForCmake(self,content,namesuffix):
> -    print("generated/%s_%s.cpp"%(self.fileName,namesuffix)),
> +    print("generated/%s_%s.cpp"%(self.fileName,namesuffix),end=" ")
>  
>    def utestFunc(self,index):
>      funcLines=[]
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list