Cast cudaArray* to thrust::device_ptr

Im using the image denoising cuda sample. Id like to calculate image noise prior to calling the filter. For that I’d like to use thrust::reduce_transform. how do I cast cudaArray to a device ptr?