Ask Your Question

Revision history [back]

hi, my board have intel hd4600 and GT740m ,I use the code below

if (!cv::ocl::haveOpenCL()) { cout << "OpenCL is not available..." << endl; //return; }

cv::ocl::Context context; if (!context.create(cv::ocl::Device::TYPE_GPU)) { cout << "Failed creating the context..." << endl; //return; }

cout << context.ndevices() << " GPU devices are detected." << endl; //This bit provides an overview of the OpenCL devices you have in your computer for (int i = 0; i < context.ndevices(); i++) { cv::ocl::Device device = context.device(i); cout << "name: " << device.name() << endl; cout << "available: " << device.available() << endl; cout << "imageSupport: " << device.imageSupport() << endl; cout << "OpenCL_C_Version: " << device.OpenCL_C_Version() << endl; cout << endl; }

cv::ocl::Device(context.device(0)); //Here is where you change which GPU to use (e.g. 0 or 1)

but context.create(cv::ocl::Device::TYPE_GPU) TYPE_GPU /TYPE_CPU TYPE_DGPU TYPE_IGPU TYPE_ALL cant not found GT740M , why? did you say this ?

by the way I use cvtest::ocl::dumpOpenCLDevice(); get my board info like this:

Intel(R) OpenCL CPU: Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz (OpenCL 1.2 (Build 76413))

    iGPU: Intel(R) HD Graphics 4600 (OpenCL 1.2 )
NVIDIA CUDA
    dGPU: GeForce GT 740M (OpenCL 1.2 CUDA)

Current OpenCL device: Type = iGPU Name = Intel(R) HD Graphics 4600 Version = OpenCL 1.2 Compute units = 20 Max work group size = 512 Local memory size = 64 kB Max memory allocation size = 324 MB 409 kB 614 B Double support = No Host unified memory = Yes Has AMD Blas = No Has AMD Fft = No Preferred vector width char = 1 Preferred vector width short = 1 Preferred vector width int = 1 Preferred vector width long = 1 Preferred vector width float = 1 Preferred vector width double = 0