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

Wrong alignment when passing structs to a kernel

dstarke
Beginner
440 Views

Hello,

I am using clSetKernelArg to pass a struct with cl_float3 values to the kernel.
cl_float3 is the same as cl_float4 and needs to be aligned at 16 byte boundary according to the OpenCL specification.
This works fine with various vendors, but not for Intel due to misalignments.
Please fix the alignment to match the required alignment of the structure in the kernel argument.

Attached you can find an example application. The expected alignment values are the least possible values to work without vload/vstore.

using device:   Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
device version: OpenCL 1.2 (Build 63463)
driver version: 1.2
result:          4,  4,  4,  8, 16
expected:        4, 16, 16,  4, 16

 

0 Kudos
0 Replies
Reply