Skip to content

Bug in vectorisation

from pystencils.session import *

vectorization_options = {'instruction_set': "neon",
                         'assume_aligned': True,
                         'nontemporal': True,
                         'assume_inner_stride_one': True,
                         'assume_sufficient_line_padding': True}


g = ps.Field.create_generic("g", spatial_dimensions=2,
                     index_shape=(1,), layout="fzyx", dtype="double")
h = g.new_field_with_different_name("h")

config = ps.CreateKernelConfig(cpu_vectorize_info=vectorization_options)
up = ps.Assignment(g.center, h.center)

ast = ps.create_kernel(up, config=config)
ast.compile()

gives:

clang: warning: /opt/local/lib/libomp/libomp.dylib: 'linker' input unused [-Wunused-command-line-argument]
/Users/holzer/Library/Caches/pystencils/objectcache/mod_71309076e2e843a225a7d8121d22b552f6c3a9eba5755088cdcc2d92cbd92e4a.cpp:22:74: error: use of undeclared identifier '_stride_g_0'; did you mean '_stride_g_1'?
         if (((uintptr_t) &_data_g_20_10[ctr_0] & _clsize_mask) == 0 && (_stride_g_0*ctr_0 + _stride_g_1*ctr_1 + _clsize/8) < _size_g_0*_size_g_1) {
                                                                         ^~~~~~~~~~~
                                                                         _stride_g_1
/Users/holzer/Library/Caches/pystencils/objectcache/mod_71309076e2e843a225a7d8121d22b552f6c3a9eba5755088cdcc2d92cbd92e4a.cpp:8:156: note: '_stride_g_1' declared here
FUNC_PREFIX void kernel_kernel(double * RESTRICT _data_g, double * RESTRICT const _data_h, int64_t const _size_g_0, int64_t const _size_g_1, int64_t const _stride_g_1, int64_t const _stride_h_1)
                                                                                                                                                           ^
1 error generated.

Vectorisation with a field of undefined size does not work properly at the moment.

Edited by Markus Holzer