PDA

View Full Version : OpenCL specification questions



uelkfr
07-21-2011, 04:19 AM
http://www.khronos.org/registry/cl/specs/opencl-1.1.pdf



page 160
half a;
half a[100];
half *p;
a = *p; <- not allowed. must use vload_half function

Isn't it should be like this?


half a;
half b[100];
half *p = b;
a = *p; <- not allowed. must use vload_half function




page 214
M_2_SQRTPI_F - Value of 2 / ??
M_SQRT2_F - Value of ?2
M_SQRT1_2_F - Value of 1 / ?2

I think this was made by some well-fed family man :) Because it is unlogical and should be M_1_SQRT2_F in last one.



page 216
gentype sub_sat (gentype x, gentype y) Returns x - y and saturates the result.

Do you think it is so detailed description? What "saturates" means???

david.garcia
07-21-2011, 05:03 PM
Thanks for pointing these out. I have created http://www.khronos.org/bugzilla/show_bug.cgi?id=497 to track the two typos.

As for the term "saturation", it means that if the result is out of range, it will be clamped to the maximum or minimum representable value. For example:



uchar a = 128;

uchar b = a + a; // <-- b will be equal to 0 because (128+128)%256 == 0

uchar c = sat_add(a,a); // <-- c will be equal to 255