[CRASH] Cudnn repair r1 softmax

Also small code refactoring.