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 create const vector variables(int4, float4, ...) in Kernel Builder

Jzhan59
Beginner
401 Views

Hi all,

Does any body know how to create const vector variables(int4, float4,...) in the Intel Kernel Builder? I had written a kernel with const vector variables and wanted to analyze it with Intel Kernel Builder. However I do not find a way to create vector variables and assign them to the kernel. Does any one know how to get this done? My kernel is written as:

__kernel void sample_kernel(__global uchar4* pTarget, __global uchar4* pSource, const int2 whSize, const float4 iColor)       { .... }

0 Kudos
2 Replies
Mohamed_Amine_BERGAC
401 Views

Hi freedayman,

You can assigne vector variables to your kernel like this : value1,value2,value3,value4 

Mohamed

0 Kudos
Oren_S_Intel1
Employee
401 Views

Hi,

In case you have a vector you want to assign, and it has repeating values (i.e. 1,1,1,1), Kernel Builder repeats the last value as many times as needed which might come in handy.

Also, here's a link to the user guide in regards to variables, which might be helpful:

http://software.intel.com/sites/products/documentation/ioclsdk/2013/UG/index.htm

Oren 

0 Kudos
Reply