Message Boards Message Boards

In OpenCL, how is problem dimensionality specified?

Posted 11 years ago

I'm trying to get my head around OpenCLLink and OpenCL programming, and would really appreciate some help. I'll outline my current understanding below, so please set me straight if I'm wrong.

My understanding is that a GPU is composed of a number of processing elements (all of which can run in parallel), and that each on runs your kernel function. Each kernel function has to determine which bit of the problem it is working on, compute its result, and put that result into an array at the appropriate location. The kernel function get_global_id(n) returns, I think, an index value for the n-th dimension of the problem, so for a 2D problem, one would call get_global_id(0) and get_global_id(1).

However, what I don't understand is how is the dimensionality of the problem specified in the first place (i.e., how is n specified), what determines the maximum value that a call to get_global_id() can return, and how do I determine "where" in the problem space a given kernel instance is working on? I can write some simple kernels that appear to work (e.g., modifying examples in the documentation), but I don't understand why they work! I'm clearly missing some vital piece of information, and find the documentation on OpenCL quite hard to follow.

Thanks in advance,

POSTED BY: Chris Rose
Posted 11 years ago
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract