The centering on GPU now works correct. The mistake was that trTotal instead of trTotalExt was passed into transform function.
test_centering was implemented. All three unit utests are passed by current state of the cuda program