cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ri239
Journeyman III

CPU runtime generating missaligned movaps calls?

We've got a very simple kernel here, which does a copy from one cl_float4 array into another, and yet it crashes when running on the CPU. The compiled x86 kernel consists basically of some address computation and a movaps call, and the movaps call gets an unaligned address (8-byte aligned instead of 16 byte.) It works fine on the GPU.

Is this a known bug? Anything we can do to work around this?

0 Likes
3 Replies
nou
Exemplar

are you sure it is right kernel? becaue on GPU you do not get memory protection so writing into wrong location did not cause segmentation fault as on CPU.

0 Likes
ri239
Journeyman III

Just found the reason, the problem seems to be that when I use CL_MEM_USE_HOST_PTR, the host memory should be already aligned -- otherwise, the copy fails. Allocating it with correct alignment resolves this issue.

0 Likes

ri239,

Failure is expected, but you should not encounter a crash. Could you post the test case which produce the crash?

0 Likes