Skip to content
Snippets Groups Projects
Commit 3e4560e5 authored by Hao Gao's avatar Hao Gao
Browse files

Disable unicode in Mako template for Python 2

parent e9a08a52
No related branches found
No related tags found
1 merge request!24Eliminate empty lists in ListOfListsBuilder
...@@ -833,15 +833,22 @@ class ListOfListsBuilder: ...@@ -833,15 +833,22 @@ class ListOfListsBuilder:
@memoize_method @memoize_method
def get_compress_kernel(self, index_dtype): def get_compress_kernel(self, index_dtype):
arguments = """
__global ${index_t} *count,
__global ${index_t} *indices,
__global ${index_t} *mask_scan,
__global ${index_t} *num_non_empty_list
"""
from sys import version_info
if (version_info > (3, 0)):
arguments = Template(arguments)
else:
arguments = Template(arguments, disable_unicode=True)
from pyopencl.scan import GenericScanKernel from pyopencl.scan import GenericScanKernel
return GenericScanKernel( return GenericScanKernel(
self.context, index_dtype, self.context, index_dtype,
arguments=Template(""" arguments=arguments.render(index_t=dtype_to_ctype(index_dtype)),
__global ${index_t} *count,
__global ${index_t} *indices,
__global ${index_t} *mask_scan,
__global ${index_t} *num_non_empty_list
""").render(index_t=dtype_to_ctype(index_dtype)),
input_expr="count[i] == 0 ? 0 : 1", input_expr="count[i] == 0 ? 0 : 1",
scan_expr="a+b", neutral="0", scan_expr="a+b", neutral="0",
output_statement=""" output_statement="""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment