Improved organization of cuda diffusion