First your OpenCV should be compiled with CUDA (and OpenGL) support to test all this features. Detect your CUDA hardware with OpenCV CUDA by:
#include <iostream>
using namespace std;
#include <opencv2/core.hpp>
using namespace cv;
#include <opencv2/cudaarithm.hpp>
using namespace cv::cuda;