change func interface in encode.cu for better time measurement