cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

evk8888
Journeyman III

clGetDeviceIDs

Regarding the "device_type" parameter in this call.

hi guys,

 

Usually the device_type is set by the user stating one of the following bit fields. CL_DEVICE_TYPE_CPU CL_DEVICE_TYPE_GPU CL_DEVICE_TYPE_ACCELERATOR

CL_DEVICE_TYPE_DEFAULT and CL_DEVICE_TYPE_ALL 

This has to be mentioned by the user as a command line arg or in the code itself (for GPU or CPU so on).  is thr anyway tht the OpenCL runtime by itself identifies the available systems? like stating there is a CPU and a GPU and we can create a context and queues based on wat we want.

 

Thanks

evk

0 Likes
2 Replies
antzrhere
Adept III

I'm not sure what your asking, but if it's whether OpenCL can automatically create command queues for every available device, then I don't think so. Otherwise you would have no idea what is going on and would be very unflexible.

You would simply get a list of all deviceIDs with CL_DEVICE_TYPE_ALL (assuming you want both CPU and GPUs, otherwise state the relevant device type), create a shared context for them and then go through every device and create a command queue for each one. Its no more than a couple of lines of code.

0 Likes

hello, thanks a lot. its true what you say....i think i will use CL_DEVICE_TYPE_ALL. thanks for your help.

0 Likes