Small scan speed up on the GPU.

- also fix crash when gcc is present, but we disable it via cxx. (Frederic B., reported by Takkachai Rittirat)
- small scan speed up on the GPU. (Frederic B.)