simple implementation of cuda version bfs