-
Notifications
You must be signed in to change notification settings - Fork 151
Porting from Vc 0.7.x to Vc 1.x
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;
}
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
).