Making changes for cuda 6; fixed compiler error