Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi theodore!

Thanks for your answer. As I understand correctly the current API von openCV 3.0 beta has some changes in the API. Actually, I am retieviing the platform info and device info using

//OpenCL: Platform Info
std::vector<cv::ocl::PlatformInfo> platforms;
cv::ocl::getPlatfomsInfo(platforms);

//OpenCL Platforms
for (size_t i = 0; i < platforms.size(); i++)
{
    //Access to Platform
    const cv::ocl::PlatformInfo* platform = &platforms[i];

//Platform Name
std::cout << "Platform Name: " << platform->name().c_str() << "\n";

//Access Device within Platform
cv::ocl::Device current_device;
for (int j = 0; j < platform->deviceNumber(); j++)
{
    //Access Device
    platform->getDevice(current_device, j);

    //Device Type
    int deviceType = current_device.type();

In the api, there is only a method like

void cv::ocl::Device::set   (void * d)

My question is, how can I use it? I really don't understand the parameter or the cast to void*. Any help would be appreciated!

Hi theodore!

Thanks for your answer. As I understand correctly the current API von openCV 3.0 beta has some changes in the API. Actually, I am retieviing the platform info and device info using

//OpenCL: Platform Info
std::vector<cv::ocl::PlatformInfo> platforms;
cv::ocl::getPlatfomsInfo(platforms);

//OpenCL Platforms
for (size_t i = 0; i < platforms.size(); i++)
{
    //Access to Platform
    const cv::ocl::PlatformInfo* platform = &platforms[i];

//Platform Name
std::cout << "Platform Name: " << platform->name().c_str() << "\n";

//Access Device within Platform
cv::ocl::Device current_device;
for (int j = 0; j < platform->deviceNumber(); j++)
{
    //Access Device
    platform->getDevice(current_device, j);

    //Device Type
    int deviceType = current_device.type();

In the api, there is only a method like

void cv::ocl::Device::set   (void * d)

from: http://docs.opencv.org/master/d7/d9f/classcv_1_1ocl_1_1Device.html#a1fa471fbcc4f193ac76ee42cbf3b9d6e

My question is, how can I use it? I really don't understand the parameter or the cast to void*. Any help would be appreciated!