You can't. It's an error to cast a global pointer to a local one. Those are separate memory spaces in OpenCL. If nVidia allows it, it's either because all their memory is implemented as global, and they just decided that it wasn't worth checking for because of that, or because of a bug in the compiler.
What you want to do is declare A_ptr as:
global float* A_ptr = A+offset;
Originally posted by: Raistmer Thanks. And I hope A_ptr itself will be placed in register ?
Hmm, this is a good question...in theory it would be a logical and smart thing to store pointers declared inside a kernel in registers, given the fact that you can't have pointers of pointers as kernel arguments and so ambiguities aren't possible, but only AMD staff can answer precisely to this question...
I don't think that's entirely correct. From the spec, page 150:
Examples:
// declares a pointer p in the __private address space that
// points to an int object in address space __global
__global int *p;
Originally posted by: Illusio I don't think that's entirely correct. From the spec, page 150:
Examples: // declares a pointer p in the __private address space that // points to an int object in address space __global __global int *p;
That's what I've said...
Originally posted by: Fr4nz
That's what I've said...
Ahh ok, sorry then. Guess I must have misunderstood what you wrote before the edit.