Fast distance calculation method for rooted tree with CUDA