How to initialize cv::UMat by using data pointer?

I have opencl, I don’t now how to allocate memory on device and initialize cv::UMat with data pointer. I can’t find the function to do this initialization.

just copy data :

UMat image;
 imread(inputName, IMREAD_COLOR).copyTo(image);

Sorry, I’ve forgotten to write. I want to initialize UMat with data pointer on device(for example intel integrated graphics), the data pointer points to a section of data, and the memory is not shared memory but device only.

does any of that help?

https://docs.opencv.org/4.x/dc/d83/group__core__opencl.html

Yes, it helped me. Thank you!