cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

vignyan
Journeyman III

Using CPU+GPU

context is not created

Hi,

I wanted to use both CPU and GPU for my computations. But when i created context with the two detected devices, it does not provide any context. I get the context when i use either a GPU or a CPU, but not both. Ofcourse, i wanted to use seperate queues for both.

Does anyone know if there is any a SDK limitation on this?

I will try to create seperate contexts and queues for GPU and CPU and schedule same jobs on both. Any reason why that's not a good idea?

Thanks,

Vignyan

0 Likes
4 Replies
omkaranathan
Journeyman III

Using CPU+GPU

You should not have any problems in creating context with both CPU and GPU. Could you post the context creation code snippet which you have written?

0 Likes
vignyan
Journeyman III

Using CPU+GPU

Attaching the code.

devices[0] = cpu; devices[1] = gpu; context = clCreateContext(0, 2, devices, NULL, NULL, &status); mAssert(status, CL_SUCCESS, "Could not create context", HARD_ERROR); /*Attach a command queue to each device in this context*/ cpuQueue= clCreateCommandQueue(context, cpu, 0, &status); mAssert(status, CL_SUCCESS, "Could not command queue for CPU", HARD_ERROR); gpuQueue= clCreateCommandQueue(context, gpu, 0, &status); mAssert(status, CL_SUCCESS, "Could not command queue for GPU", HARD_ERROR);

0 Likes
gaurav_garg
Adept I

Using CPU+GPU

You need to change your code to work with ICD. take a look at-

http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=71

0 Likes
omkaranathan
Journeyman III

Using CPU+GPU

vignyan,

In your code,

        devices[0] = cpu;
        devices[1] = gpu;

What are the datatypes of cpu and gpu?

Could you post your host side code?

0 Likes