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