In general, the patch LGTM, but it seems that there are something incorrect
in the patch. When I apply this patch to the master branch, I got the following
error message:

Applying: Allow building with Python 3
fatal: corrupt patch at line 19

After look into the patch file, I found the patch file is malformed:

On Sun, Apr 26, 2015 at 09:25:45PM +0100, Rebecca N. Palmer wrote:
> 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 <[email protected]>
> 
> 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

"-61, +62" means the following block adds one more line:

>  # 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)]

But we can see that the above block delete two lines and add two lines, the 
total
lines should be the same. The pach itself is in malformed format.

Could you take a look at it?

Thanks,
Zhigang Gong.
_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to