I'm worried that reading and writing the intermediate pipes can be too slow. Is it possible to use some binary format like Fortran? (Is the binary format of Fortran faster?)
Data has to get transferred from the GPU eventually, so breaking it up into steps back and forth does seem like over (under?) kill. Hopefully, since they're pipes in memory it won't be so bad as going to disk.