Skip to content
Snippets Groups Projects

Shortcut straight to ecm.map_constant when emitting (potentially large) array literals (#118)

Merged Andreas Klöckner requested to merge faster-array-literals into master
1 file
+ 1
2
Compare changes
  • Side-by-side
  • Inline
@@ -194,7 +194,6 @@ def generate_array_literal(codegen_state, array, value):
ecm = codegen_state.expression_to_code_mapper
from pymbolic.mapper.stringifier import PREC_NONE
from loopy.expression import dtype_to_type_context
from loopy.symbolic import ArrayLiteral
@@ -203,7 +202,7 @@ def generate_array_literal(codegen_state, array, value):
codegen_state.ast_builder.get_c_expression_to_code_mapper(),
ArrayLiteral(
tuple(
ecm(d_i, PREC_NONE, type_context, array.dtype).expr
ecm.map_constant(d_i, type_context)
for d_i in data)))
# }}}
Loading