different results (nan values)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

different results (nan values)

ggeo
Hello,

I am running a program which ,generally,runs fine but,

when i am taking the result ( a matrix) sometimes it's ok and sometimes it has nan values inside.


I can't understand that behaviour.

(i am using linux 64bit)

Reply | Threaded
Open this post in threaded view
|

Re: different results (nan values)

Andreas Kloeckner
On Mon, 14 May 2012 09:14:59 -0700 (PDT), ggeo <[hidden email]> wrote:

> Hello,
>
> I am running a program which ,generally,runs fine but,
>
> when i am taking the result ( a matrix) sometimes it's ok and sometimes it
> has nan values inside.
>
>
> I can't understand that behaviour.
>
> (i am using linux 64bit)
Welcome to parallel programming.

https://en.wikipedia.org/wiki/Race_condition

:)

Andreas

_______________________________________________
PyCUDA mailing list
[hidden email]
http://lists.tiker.net/listinfo/pycuda

attachment0 (195 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: different results (nan values)

ggeo
This post was updated on .
Ok, that simple!


Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: different results (nan values)

ggeo
So, is there a way to clear the memory in pycuda?


Maybe the memory collects garbage that 's why the different results?


Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: different results (nan values)

Andreas Kloeckner
On Wed, 23 May 2012 06:03:23 -0700 (PDT), ggeo <[hidden email]> wrote:
> So, is there a way to clear the memory in pycuda?
>
>
> Maybe the memory collects garbage that 's why the different results?

There is such a thing. pycuda/examples/fill_gpu_with_nans.py.

But you should realize that if your result depends on the previous state
of memory, that is called:
https://en.wikipedia.org/wiki/Undefined_behavior

I.e. your program is wrong, end of story.

Andreas

_______________________________________________
PyCUDA mailing list
[hidden email]
http://lists.tiker.net/listinfo/pycuda

attachment0 (195 bytes) Download Attachment