updated to compile with modern Thrust