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.
1722 Discussions

question on autovectorization

Fu_J_Intel
Employee
396 Views

Does  autovectorization work on below kernel? 

__kernel void vec_add(__global const float* in1, __global const float* in2, __global float* out)
{
    int i=get_global_id(0);

    int j=(i<<2);
    out=in1+in2;
    out[j+1]=in1[j+1]+in2[j+1];
    out[j+2]=in1[j+2]+in2[j+2];
    out[j+3]=in1[j+3]+in2[j+3];

}

thanks,

Jeffrey

0 Kudos
1 Reply
Robert_I_Intel
Employee
396 Views

Hi Jeffrey,

Yes, but you may want to use float4 data type instead. Please see my reply to your other post.

0 Kudos
Reply