add CPU timer
use cudaMallocHost in encode.cu