CUDA, QT UI CUDA send some specal msg to HOST when the program ends?

Dear all,

I am building a UI with Qt for a CUDA application under WinXP,
my procedure is:
(1) build the CUDA procedure to a dll/lib.
(2) link the UI program to call the CUDA procedure.

It works fine so far( I mean, the UI does take control the execution of the CUDA procedure ).
But the interesting part is: after the second time the CUDA execution is done, the UI is killed automatically.
(I press the button to call the cuda procedure, first time after the execution is done, the result is written out,the button is released,
then I press the button again to call the cuda procedure, after the execution is done, the result is written out, the UI is killed too. And seems the control is not given back to my UI program back, because the second time, the break point is even not reached)

void uistart()
{
runSimulation(m_energy, m_hflag, m_hratio, m_nblocks, m_nthreads);
printf(“testing!”); // breaking point here, it did not stop on second time before the ui is killed
}

can anybody give some hint about it?

Best

What does the runSimulation function do ?

What API calls does it do ?

Why compile to dll ?

If you use VS to compile and debug CUDA code, there are Qt packages for VS compiler so it’s possible to have a normal Qt + CUDA project.

As for Qt + CUDA, what I did is I copied the Nsight project from demos.
Changed it to my project, checked if it worked.
Then I created a Qt project with the same name as the previous one.
Then I merged project. Copied files from Qt project (overwrite main.cpp),
merged .vcproj file -> in text editor:

  • added the Qt specific filters,
  • added files from Qt project,
  • changed build rules for those files
    And I think that’s all, then it compiled just fine.
    I don’t know how to set compile order, so sometimes I had to compile
    manually .ui and main header file (if project is named tmp, then the file is tmp.h).