prepare cuda for merge