Skip to content

Porting from Vc 0.7.x to Vc 1.x

Matthias Kretz edited this page Mar 23, 2016 · 5 revisions

AVX::int_v::Size changed

In 0.7 the number of elements in int_v and float_v was guaranteed to be equal. Since this does not reflect actual reality of SIMD hardware, the guarantee was dropped in Vc 1.0. Consequently, conversions between (u)int_v and float_v are not implicit anymore. If you should do an explicit conversion using e.g. simd_cast you risk dropping data or generating zeros. Instead you likely want to use the new SimdArray class template. Example:

using float_v = Vc::float_v;
using int_v = Vc::SimdArray<int, float_v::size()>;

int_v f(int_v x) {
  float_v fx = x;
  fx = do_stuff(fx);
  return fx;
}

cmake changes

Vc 0.7 shipped convenient macros to determine compiler flags and to support multi-target compilation. The same features are still available with 1.0. However, the old Vc_DEFINITIONS variable has changed to only include actual -D flags. All the other flags have moved to Vc_COMPILE_FLAGS and Vc_ARCHITECTURE_FLAGS. The Vc_ALL_FLAGS variable contains a union of the three (which is thus the drop-in replacement for 0.7's Vc_DEFINITIONS).

Clone this wiki locally