__saturate is undefined error Intrinsic function on p 139 of programming guide

When I try to compile with the function [font=“Courier New”] __saturate(x)[/font], as described on p 139 of the Programming Guide, it says the function is undefined.

Has anyone successfully used this intrinsic function?

Actually there seems to exist a function with an ‘f’ (as in float) on the end: [font=“Courier New”]__saturatef(x)[/font] appears to work as intended.

Can anyone (Nvidia staff?) confirm that it’s a typo in the guide?


device_functions.h has this prototype:

extern device float __saturatef(float);

So the documentation appears to be in error. I will notify the documentation team. BTW, the two instances of __saturate I can find in the CUDA 4.0 Programming Guide are on pages 151 and 152; I assume I cannot find it on page 139 because you are looking at an older version of that document?

thanks for confirming that.

I believe you’re looking at the raw page count from the start of the PDF.

I was referring to the number printed at the bottom of the page. We are referring to the same page in Version 4.0 of the Programming Guide :thumbup:

The Programming Guide from 4.0rc2 has it on pages 139 and 140.
If rc2 is so different from 4.0 final, I guess I should install it soon…

EDIT: No need to install then…

Yes, indeed :-) Anyhow, I have filed a bug to make sure this gets fixed for the next release. Sorry for the inconvenience, and thanks for bringing this to our attention.

No worries. Glad to be of assistance!
Am I to believe nobody has used this function?? Maybe everyone just figured out, or misread rightly, that it should have an ‘f’ on the end as all other functions in that section do.

Anyway I just discovered it and it’s incredibly useful in getting rid of divergent threads, provided you can use a transformation that makes the non-contributing parameter into a negative value.

Keep up the great work NVIDIA

True, usage of “saturate” is yet to saturate…

Just ‘re-discovered’ this error in the programming Guide. They gonna fix this? It’s been in there since at least the 0.9 rev. (5+ years I think).