fixed GPU compiler error

It seems it was the const_iterator update from my patch, which was not a feature of all compilers.