How to implement simple transparency using cv::cuda?

Hi,
In my first CV_8UC4 image all pixels have alpha = 1, in the second image some pixels have alpha = 0, others = 1.
If second image pixel has alpha 0, I want to take pixel from the first image, otherwise from the second.
What is the best way to do that using cv::cuda?
Thank you