Fixed GPU module build with CUDA 5.5 RC on linux

Rewrote `gpu/device/vec_math.hpp` file (now it doesn't depend on `functional.hpp`).

Also fixes several regression and sanity tests failures (NPP Box filter and Brox Optical Flow).