final modifications to distribute gpu impl