CUDA ClassNLLCriterion implementation