Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted
##

Hi,

Polar01

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-12-2011
06:47 AM

13 Views

pow : crash

I use the pow function in my kernel and when I do

float v = pow(0.00001f, 1000.f);

I got a crash !

I use a lot this function and don't know if it is due to my context !

But this simple line make my soft crashing with the last SDK :-(

6 Replies

Highlighted
##

Bad news,

Polar01

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-12-2011
07:22 AM

13 Views

The problems sounds related to the context, when I use this method somewhere else... no problem !

So, how can I help you to debug the problem ?

Thanks

Highlighted
##

Evgeny_F_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-12-2011
07:23 AM

13 Views

Hi,

Can you provide small reprodusor of this issue, few host lines and small kernel?

Thanks,

Evgeny

Highlighted
##

I think that the problem is more complex than this !

Polar01

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-12-2011
07:47 AM

13 Views

I can't provide you a "simple" reproductor ! It is what I say when I tell you that it is a bad news :-(

In fact, the crash occur when I add the simple following line in my software :

float v = pow(0.1f, 1000.f);

in a specific function !

I have also try to replace the pow with :

inline float POW(float value, float exponent)

{

for(uint i = 0; i < exponent; i++)

value *= value;

return value;

}

And it works ! So there is something wrong with the SDK !

So, I can give you access to the full code, but you will have to invest time to debug this way... it is a big application with a lot of OpenCL code !?

Highlighted
##

I have also try the following methods, but all failed :

Polar01

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-12-2011
08:18 AM

13 Views

#define POW(VALUE,EXPONENT) powr(VALUE,EXPONENT)

#define POW(VALUE,EXPONENT) pow(VALUE,EXPONENT)

#define POW(VALUE,EXPONENT) pown(VALUE,EXPONENT)

#define POW(VALUE,EXPONENT) exp(EXPONENT*ln(VALUE))

The problem sounds to be in the 'ln' function (not the exp I think)

Highlighted
##

I have also try :

Polar01

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-12-2011
08:40 AM

13 Views

#define POW(VALUE,EXPONENT) exp(EXPONENT*log1p(VALUE-1.f))

And it works !

Because if I remember :

pow(x, exponent) = exp(exponent * log_e(x))

so, because log1p(x) = log_e(1 + x) I just have to remove 1 !

Of course it is just a fix, you still have a problem in the SDK ! For sure a lot of peoples will use it !

Highlighted
##

Polar01

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-13-2011
12:04 AM

13 Views

I have finaly fixed it like this :

#define POW(VALUE,EXPONENT) exp(EXPONENT*log(VALUE))What can I do to help you ?

For more complete information about compiler optimizations, see our Optimization Notice.