线程地址空间(Thread Address Space)
thread地址空间修饰符表示其所修饰的地址为线程的私有空间, 仅仅在其被声明的线程可见, 在graphics和kernal函数内所声明的变量都是在线程地址空间上分配的。代码实例如下:
kernel void my_func(...)
{
// A float allocated in the per-thread address space
float x;
// A pointer to variable x in per-thread address space
thread float p = &x;
...
}