PDA

View Full Version : Context with different vendors



luizdrumond
10-30-2012, 10:20 AM
Hi,

I tried create a context colaborative with 2 differents vendors. Because, my machine have a CPU INTEL and a NVidia GPU, but when run, a execution error occurs.

Below follow my code:

cl_platform_id plataforma[2];
cl_uint total_de_plataformas;

clGetPlatformIDs(2, plataforma, &total_de_plataformas);

cl_device_id dispositivo[2];
cl_uint num_devices;

clGetDeviceIDs(plataforma[0], CL_DEVICE_TYPE_GPU, 1, dispositivo[0], &num_devices);
clGetDeviceIDs(plataforma[1], CL_DEVICE_TYPE_CPU, 1, dispositivo[1], &num_devices);

cl_context contexto;

int err;
contexto = clCreateContext(NULL, 2, dispositivo, NULL, &err ); //In this line the execution error occurs.


Thanks,

someanonperson
10-31-2012, 03:28 AM
Hello Luizdrumond,

If I look at the OpenCL UML class diagram http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/classDiagram.html, it seems that there can be only one platform per context.

Unfortunately you must create two separate contexts per platform.

luizdrumond
10-31-2012, 11:12 PM
Hi,

Very thanks for you help.