message(FATAL_ERROR "opencv missing. please install opencv")
endif(OpenCV_LIBS)
-#find opencv ocl headers:
-INCLUDE (CheckLibraryExists)
-CHECK_LIBRARY_EXISTS(cl clCreateImage /usr/lib/beignet ocl)
+option(ocl "enable opencl" OFF)
if(ocl)
message(STATUS "found opencv ocl headers. enabling opencl support. ${ocl}")
message(STATUS "no opencl support")
endif(ocl)
-find_path(cuda gpu.hpp PATH_SUFFIXES opencv/gpu opencv2/gpu DOC "opencv cuda headers")
+option(cuda "enable cuda" OFF)
if(cuda)
message(STATUS "found opencv cuda headers. enabling cuda support. ${cuda}")
add_definitions(-DCUDA)
else(cuda)
message(STATUS "no opencv cuda headers found. no cuda support")
+ remove_definitions(-DCUDA)
endif(cuda)
include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
#include "timestamp.h"
#include <iostream>
-#include <boost/assert.hpp>
-#include <boost/thread/future.hpp>
#ifdef OPENCL
#include <opencv2/ocl/ocl.hpp>
#ifdef OPENCL
if(shared->useOpenCl)
{
- std::vector<cv::ocl::Info> info;
- cv::ocl::getDevice(info);
+ cv::ocl::PlatformsInfo platforms;
+ cv::ocl::getOpenCLPlatforms(platforms);
- DebugOut()<<"There are "<<info.size()<<" OpenCL devices on this system"<<endl;
+ for(auto p : platforms)
+ {
+ DebugOut(1)<<"platform: "<<p->platformName<<" vendor: "<<p->platformVendor<<endl;
+ }
+
+ cv::ocl::DevicesInfo info;
+ cv::ocl::getOpenCLDevices(info, cv::ocl::CVCL_DEVICE_TYPE_ALL);
+
+ DebugOut(1)<<"There are "<<info.size()<<" OpenCL devices on this system"<<endl;
if(!info.size())
{
- DebugOut()<<"No CL devices. Disabling OpenCL"<<endl;
+ DebugOut(1)<<"No CL devices. Disabling OpenCL"<<endl;
shared->useOpenCl = false;
}
+ else
+ {
+ cv::ocl::setDevice(info[0]);
+ }
- for(cv::ocl::Info i : info)
+ for(auto i : info)
{
- for(auto name : i.DeviceName)
+ for(auto name : i->deviceName)
{
- DebugOut()<<"DeviceName: "<<name<<endl;
+ DebugOut(1)<<"OpenCLDeviceName: "<<name<<endl;
}
}
}
/*if(shared->threaded)
{
- auto luxFuture = boost::async([m_image, &shared](){ return evalImage(m_image,shared); });
- luxFuture.then([&shared](boost::shared_future<uint> f) { shared->parent->updateProperty(f.get()); });
+
}
else*/
{