When will I get some profit of using restrict for __gloabal variable?
(__global restrict float *)
Good question!
What profit do you expect to see?
I do not know, may be "better memory access".
OpenCL Compile Error: clBuildProgram failed (CL_BUILD_PROGRAM_FAILURE).
Line 259: error: "restrict" is
not allowed
__kernel void Calc_ALL(__global restrict uint * in1,
gat3way,
restrict keyword is used to tell the compiler that the pointer does not alias with any other pointer argument.This helps compiler in doing more optimized compilation.
http://en.wikipedia.org/wiki/Restrict
zeland,
try __kernel void kernel(__global uint * restrict in1,...)
Thanks. I've read Wiki. i want to what exactly do restrict in Amd implementation of OpenCL. And when it is better to use it or not. When will i feel difference?
zeland,
You can use restrict keyword for any pointer when you are sure the buffer will be accessed by only that pointer.And no pointer aliasing can happen.
IT can make the reordering of instructions more flexible which can improve performance.
Originally posted by: himanshu.gautam zeland,
You can use restrict keyword for any pointer when you are sure the buffer will be accessed by only that pointer.And no pointer aliasing can happen. IT can make the reordering of instructions more flexible which can improve performance.
Thanks. So every time when pointer variable will be accessed by the only pointer, and this is rather typically, i should use restrict keyword for may be better performance.