fixed issues in gpu discretization