PDA

View Full Version : incompatible integer to pointer conversion!!



phoebe0105
04-30-2010, 12:46 AM
If this error is occured, what am I do it?
Plez advise to me.

:70: warning: incompatible integer to pointer conversion assigning 'int', expect
ed 'int __attribute__((address_space(1)))*'
resDestoffset = destoffset;
^ ~~~~~~~~~~


"resDestoffset" is __global int*.. and "destoffset" is only "int"..
I don't understand at openCL memory block.. -_?

ibbles
04-30-2010, 03:52 AM
As you say, one of the variables is a pointer and the other is not. They cannot be assigned to each other just like that, so you have to give a better description of what you are trying to do.

phoebe0105
04-30-2010, 09:57 AM
As you say, one of the variables is a pointer and the other is not. They cannot be assigned to each other just like that, so you have to give a better description of what you are trying to do.

I just send from int data to __global int pointer.

destoffset(int data) is computed in kernel source.
And then resDestoffset(__global int*) is received the destoffset data..(I want it..)

It is not error but warning.
sooner or later it is occured another error.(I think it..)

ibbles
05-02-2010, 11:23 PM
I guess you want to write to where the the pointer points and not to the pointer itself. The following code will do that.



(*resDestoffset) = destoffset;

phoebe0105
05-02-2010, 11:40 PM
I guess you want to write to where the the pointer points and not to the pointer itself. The following code will do that.



(*resDestoffset) = destoffset;


thank you for your advise.

I just follow right now..
If another problem is occured, I write this board. Thank you.