OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

How to convert uint4 to unsigned int

nikey1
Beginner
594 Views

Hi guys,
I am trying to copy an image from source to destination. I am using the readimageui() routine in the kernel and this returns uint4 type. So when using the writeimageui() I just want to write it as of type unsigned int. Then I can write it to the destination buffer which in the host code, is of type unsigned int.
Please tell me how do I convert the uint4 vector type to unsigned int..

0 Kudos
1 Reply
Raghupathi_M_Intel
594 Views

You can always access the components of the vector data type with 4 elements as .xyzw. Basically uint4 is 4 unsigned ints in contiguous locations in memory and typically mapped to the underlying SIMD hardware. Hope that helps.

Raghu

0 Kudos
Reply