Move subroutine used by multi-GPU routines to separate header