adaption of dz.cuh and dz.h