The order of parameters in kernel function

Discussion created by firemars on Jul 29, 2011
Latest reply on Aug 3, 2011 by nou

Hi all, I got a problem when I run my application on Intel i7 CPU.

First all, the code works fine on my AMD GPU.

But when I run it on CPU, I got segment fault when I access the memory object in the kernel function. The problem is very weird.

if my kernel function is like this: kernel(int variable, __global buffer), I got segment fault when I access buffer.

But if I exchange the order of parameters: kernel(__global buffer, int variable), it works fine.

In addition, if I add one more int variable before buffer: kernel(int var, int var, __global buffer), it also works.

So I am wondering whether some alignement problem is incurred when I run the code on CPU. By the way, my CPU is 64bit.