// hybrid stage of decoding image, involves device async calls // note that jpeg stream is a parameter here - because we still might need copy // parts of bytestream to device public void DecodeJpegTransferToDevice(JpegStream jpegStream, CudaStream cudaStream) { res = NvJpegNativeMethods.nvjpegDecodeJpegTransferToDevice(_nvJpeg.Handle, _decoder.Decoder, _state, jpegStream.Stream, cudaStream.Stream); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nvjpegDecodeJpegTransferToDevice", res)); if (res != nvjpegStatus.Success) { throw new NvJpegException(res); } }