p12tic/libsimdpp — pull request #20 by michalfapso (2014-09-23 10:34:31+00:00)
Title: dynamic dispatch working example

Hi Povilas, thanks again for the great work you did on the libsimdpp!

I had problems to make the dynamic dispatching work following the doc/src/dispatch.md tutorial. There were some simple typos, but the main issue was with the following compiler error:

g++ test.cc -c -std=c++11 -I../../ -o test_null.o
In file included from ../../simdpp/dispatch/dispatcher.h:213:0,
from ../../simdpp/simd.h:176,
from test.cc:2:
test.cc: In function ‘void print_arch()’:
../../simdpp/dispatch/macros.h:63:20: error: ‘SIMDPP_USER_ARCH_INFO’ was not declared in this scope
>::get_fun_ptr(SIMDPP_USER_ARCH_INFO)(); \
^

I have fixed it by using the get_arch_gcc_builtin_cpu_supports function. When I added also AVX2 architecture to the example, there were two more errors in simdpp/detail/insn/bit_xor.h and simdpp/detail/insn/splat_n.h

Feel free to modify the patch as you like :o)

Regards,
Miso