Added memory swapping for final kernel fusion