how to use DeviceInfo() class from opencv

i am actually new to using classes so i cant really figure out the correct usage of this class

#include <opencv2/opencv.hpp>
#include <opencv2/core/cuda.hpp>
#include <time.h>
#include <sys/time.h>

using namespace cv;
using namespace std;

typedef unsigned long long timestamp_t;

static timestamp_t get_timestamp(){
    struct timeval now;
    gettimeofday (&now, NULL);
    return  now.tv_usec + (timestamp_t)now.tv_sec * 1000000;
}

int main()
{
    timestamp_t t0 = get_timestamp();

    int gpucount = cuda::getCudaEnabledDeviceCount();
    if(gpucount != 0){
        cout << "no. of gpu = " << gpucount << endl;
    }
    else
    {
        cout << "There is no CUDA supported GPU" << endl;
        return -1;
    }
    cuda::setDevice(0);
    //cuda::resetDevice();
    enum cuda::FeatureSet arch_avail;
    if(cuda::TargetArchs::builtWith(arch_avail))
        cout << "yes, this Gpu arch is supported" << endl;

///////////////////////////////////////////////////////
    cuda::DeviceInfo deviceinfo;
    deviceinfo.cuda::DeviceInfo::DeviceInfo();
///////////////////////////////////////////////////////

    //deviceinfo.name()

    timestamp_t t1 = get_timestamp();
    double secs = (t1 - t0) / 1000000.0L;
    cout << "Time taken to initiliase: " << secs << " seconds" << endl;
}

this is my code i am using and it is to initilize and benchmark cuda each step and understand what is everything doing
and also i am not using namespace cuda to understand clearly

and i am stuck at

cuda::DeviceInfo deviceinfo;
    deviceinfo.cuda::DeviceInfo::DeviceInfo();

and i am getting ‘deviceinfo’ is not a member of ‘cv::cuda::DeviceInfo’ error
and if i do

cuda::DeviceInfo deviceinfo;
    deviceinfo.DeviceInfo();

it is saying Invalid use

so i dont know what to do

link to cuda docs:http://docs.opencv.org/3.0-beta/modules/cuda/doc/initalization_and_information.html

ok, lol dumb me i should have paid a little more attention, it says it is a constructor so i guess it will automatically run and generate the class atrributes

#include <opencv2/opencv.hpp>
#include <opencv2/core/cuda.hpp>
#include <time.h>
#include <sys/time.h>

using namespace cv;
using namespace std;


typedef unsigned long long timestamp_t;

static timestamp_t get_timestamp(){
    struct timeval now;
    gettimeofday (&now, NULL);
    return  now.tv_usec + (timestamp_t)now.tv_sec * 1000000;
}

int main()
{
    timestamp_t t0 = get_timestamp();

    int gpucount = cuda::getCudaEnabledDeviceCount();
    if(gpucount != 0){
        cout << "no. of gpu = " << gpucount << endl;
    }
    else
    {
        cout << "There is no CUDA supported GPU" << endl;
        return -1;
    }
    cuda::setDevice(0);
    //cuda::resetDevice();
    enum cuda::FeatureSet arch_avail;
    if(cuda::TargetArchs::builtWith(arch_avail))
        cout << "yes, this Gpu arch is supported" << endl;

    cuda::DeviceInfo deviceinfo;
    cout << "GPU: "<< deviceinfo.cuda::DeviceInfo::name() << endl;

    //deviceinfo.name()

    timestamp_t t1 = get_timestamp();
    double secs = (t1 - t0) / 1000000.0L;
    cout << "Time taken to initiliase: " << secs << " seconds" << endl;
}

the above code works and the result is

tinku@tinku-P65-P67SE:~/machine vision/testing$ ./stereotest
no. of gpu = 1
yes, this Gpu arch is supported
GPU: GeForce GTX 970M
Time taken to initiliase: 0.077813 seconds

but what if i did not initilize the GPU, how can i pass the GPU ID to the constructor?

and can i ask this questions here or should i go to opencv forums?