If it is possible to use cudaoptflow in Tx2?

Hello,
I’m doing a project that should use dense optical flow in tx2, but I don’t known how to use cudaopticalflow in opencv4tegra like do that in my computer.Because I want to make a real-time program. So I think I’d better to use the gpu version.
Maybe there is no such module in opencv4tegra? If that,How can I solve this problem?
Thanks

OpenCV4Tegra is now the same as upstream OpenCV 3.3.1, you would want to recompile it with GPU/CUDA enabled and then use the cudaoptflow module: https://docs.opencv.org/3.3.1/d7/d3f/group__cudaoptflow.html

Alternatively you will likely get better out-of-the-box performance using VisionWorks optimized optical flow.