Tweak device abstraction so CPU_ONLY build works

Added some `#ifndef CPU_ONLY` guards around the GPU code and included math.h for pow/sqrt in filler.hpp and solver.hpp -- not sure why that's necessary, but it wouldn't build for me or Travis without it (see my comment in #610).  Hopefully this makes Travis pass, after which I'll merge this into the device-abstraction feature dev branch.