cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

richeek_arya
Journeyman III

OpenCL kernel arguments without address space qualifiers

Hi all,

I was working in OpenCL development and had some conceptual questions.

In the the OpenCL manual it is written that:

"All arguments to a __kernel function shall be in the __private
address space."

Suppose I take a protoype kernel definition from the sample codes:

void matrixTranspose(__global float * output,
                     __global float * input,
                     __local  float * block,
                     const    uint    width,
                     const    uint    height,
                     const    uint blockSize
                       )

Now I have two questions in that:

1. All the aruments preciding with __global and __local are defined in global address space since they explicitly have "global" address qualifier. Is it true?

2. For rest of the arguments(width, height and blockSize) are they in the __private address space?  Does it mean every thread has copy of those variables?

Thanks

Richeek

0 Likes
2 Replies

All arguments to a kernel are in the private address space. For the pointers, the variables themselves are in the private address space, but point to memory that is in the global or local address space.

Since all arguments are in the private address space, each thread has its own copy.
0 Likes

Thanks Micah, that answers my question

0 Likes