cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

guenthernoack
Journeyman III

"INFINITY" doesn't work

Hi!

Is there a way to set a float variable to infinity from inside a kernel? (The C constant INFINITY doesn't work, as it's not explicitly passed into the kernel.)

-Günther

Tags (1)
0 Likes
3 Replies
dukeleto
Adept I

"INFINITY" doesn't work

There has been no answer to this question, and I'm also very interested in hearing,so I'm bumping it;
I have seen a number of references stating that hardware since the R600 or so supports IEEE 754 floating
point, so NaNs & Infs, but a function like isnan() is not accepted by the brcc. How is one to use the hardware
capacity?
Thanks
0 Likes
rlindner
Journeyman III

"INFINITY" doesn't work

I didn't try it, but maybe a = 1.0 / 0.0; works for infinity and a = 0.0 / 0.0; for NaN - as for checking for these values, I have no clue

0 Likes
guenthernoack
Journeyman III

"INFINITY" doesn't work

Good idea! The resulting kernel code contains:

div_zeroop(infinity) r357.x___,l12.x000,l0.x

"zeroop" seems to suggest that no operation will be performed in the assembled machine code. Is that correct?

0 Likes