if I set the context is CL_DEVICE_TYPE_ALL,how are work items assigned to the graphics card and CPU? Equally, or other?
when you set CL_DEVICE_TYPE_ALL you get context with two or more devices. CPU and GPU's. but you still enqueue task into individual device queue so you must implement load balancing on your own.
I ignored the Device parameter of the function clCreateCommandQueue.
Because we do not know the performance of client‘s CPU and GPU ?it is difficult to implement load balancing.Do you have any good idea?
measure time which take to execute enqueued task and change workload accordingly.compute some sort of performance index.
but IMHO combining CPU and GPU is not so good idea. because most application will need CPU to prepare data.
The advantage of combining the two is that you can let the run time manage the interaction rather than yourself doing work. You could prepare the work in a CL task on the host and use an event to trigger GPU work. Letting the runtime manage this should allow some extra overlapping that waiting for the queue to finish on the host would not allow.
It may not work now, but that's the theory, anyway.
Retrieving data ...