Menu

#35 pow doesn't work

1.5
open
nobody
brcc (29)
5
2009-05-27
2009-05-27
GEN
No

This works-

kernel void pi_GregoryLeibniz(float size, out float output<>
{
float2 pos = indexof(output).xy;
float i = size * pos.x + pos.y;
int x;
float temp=1.0f;

//output = (pow(-1.0f, i)) * (4.0f / (1.0f + 2.0f * i));

for(x=0;x<(int)i;x++)
{
temp *=-1.0f;
}
output = temp*(4.0f / (1.0f + 2.0f * i));
}

But, this doesn't-

kernel void pi_GregoryLeibniz(float size, out float output<>
{
float2 pos = indexof(output).xy;
float i = size * pos.x + pos.y;
output = pow(-1.0f, i) * (4.0f / (1.0f + 2.0f * i));
}

Forum URL : http://forums.amd.com/forum/messageview.cfm?catid=328&threadid=109273&forumid=9

Discussion


Log in to post a comment.

MongoDB Logo MongoDB