Store integer in OpenCL node

   1268   2   1
User Avatar
Member
59 posts
Joined: April 2006
Offline
Hi,
I cannot find the way to store/write integer value back to the attribute. For vectors we use vstore3 (ie, vstore3(value, idx, P)), what should I use for integers?

Thanks!
User Avatar
Member
172 posts
Joined: Jan. 2014
Offline
Hi,

As it's just a huge array of integers you can have access to the element of the array using this syntax.
Where idx is the current work item.
Make sure you have your parameters for readable/writeable turned on.
yourattrib[idx] = value;

vstore3 is no more than
DIM could be any number depends on your dimension size, for vectors it's 3
{
int block = idx*DIM;
dataout[block]   = datain.x;
dataout[block+1] = datain.y;
dataout[block+2] = datain.z;
}
Edited by Ivan L - Dec. 24, 2019 20:34:00
I contribute to the beauty of this world
User Avatar
Member
59 posts
Joined: April 2006
Offline
Thanks!
  • Quick Links