moved file output to device vector for median filter example