cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

dompazz
Journeyman III

task parallel guidence

I'm new to OpenCL.  I'm trying to solve a task parallel problem in which values in a grid are dependent upon the solved gird values directly above and directly to the left.  (ie in a row major layout, [i,j] depends on [i,j-1] and [i-1,j]).

I would like to use the clEnqueueTask and event structure to enqueue the grid and have each cell waiting on the events of the dependent cells.  This seems to be problem OpenCL was made for.

I cannot find any good examples of this to work from.  I am spinning my wheels trying things and failing miserably.  Any pointers would be greatly appreciated.

One specific question --do I need a separate cl_kernel instance for each cell, or can create 1 and reuse it for all cells?

Thanks

0 Likes
4 Replies
nou
Exemplar

task parralel is not possible on current HW. i mean it is possible but not efficient. you should transform your problem to some sort of reduction problem.

and yes you can reuse one kernel multiple times.

0 Likes

I understand it is not efficient on the GPU; I am targeting the CPU.  Or are you saying that it is not efficient there as well?

 

0 Likes

on CPU it could be a efficient. but you must enable out of order execution (which is not supported currently?) or create sub devices per core with cl_ext_device_fission and manage dispatch of task on your own.

0 Likes

I didn't realize out of order execution was not supported in the current version.  If that is the case, it probably explains why my code is blowing up.

Thank you for the info.

0 Likes