Calling cudppDestroyPlan from different threads CUDPP thread safety


I would like to know if CUDPP is thread-safe, in the sense that I’ll describe next.
I have two worker threads. Each thread is assigned to a different gpu device. I’m creating two plans to perform a scan operation on each device. Each plan is being created in the context of the thread that’s going to use it (each CUDPPHandle is in the stack of the thread that created it). The problem is that the second cudppDestroyPlan call fails (the debugger halts and warns about a memory corruption). In other words, the cudppDestroyPlan call that fails is the one that is called in last place.

I’m using Visual Studio 2005, and CUDA 2.1.

Any comment or hint would be greatly appreciated.


Federico Milano