Fixed compilation on non-osx.
Fixed test behavior when not running on GPU target.