Relating the description of gluon production in pA collisions and parton energy loss in AA collisions