Updating cuda code