| 1 |
{# USES_VARIABLES { N } #} |
| 2 |
{# ALLOWS_SCALAR_WRITE #} |
| 3 |
{% extends 'common_group.pyx' %} |
| 4 |
|
| 5 |
{% block maincode %} |
| 6 |
cdef size_t _N = {{constant_or_scalar('N', variables['N'])}} |
| 7 |
_vectorisation_idx = 1 |
| 8 |
|
| 9 |
{{scalar_code['condition']|autoindent}} |
| 10 |
{{scalar_code['statement']|autoindent}} |
| 11 |
|
| 12 |
for _idx in range(_N): |
| 13 |
_vectorisation_idx = _idx |
| 14 |
|
| 15 |
{{vector_code['condition']|autoindent}} |
| 16 |
if _cond: |
| 17 |
# this looks silly but is necessary to avoid an error if there is |
| 18 |
# no vector code (setting a scalar variable) |
| 19 |
pass |
| 20 |
{{vector_code['statement']|autoindent}} |
| 21 |
|
| 22 |
{% endblock %} |