Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your kernel is expecting dynamically allocated <a href="http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#shared" rel="nofollow noreferrer">shared memory</a>:</p> <pre><code> extern __shared__ int Shared_Hash[]; // blockSize + 1 elements </code></pre> <p>But you aren't allocating any in your kernel invocation:</p> <pre><code>sort_Particles_And_Find_Cell_StartD&lt;&lt;&lt;numBlocks, numThreads&gt;&gt;&gt;(Cell_Start,Cell_End, Sorted_Pos, Sorted_Vel, Particle_Cell, Particle_Index, Old_Pos, Old_Vel, Num_Particles); ^ | missing shared memory size parameter </code></pre> <p>You should provide a shared memory amount in your <a href="http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#execution-configuration" rel="nofollow noreferrer">launch configuration</a>. You probably want something like this:</p> <pre><code>sort_Particles_And_Find_Cell_StartD&lt;&lt;&lt;numBlocks, numThreads, ((numThreads+1)*sizeof(int))&gt;&gt;&gt;(Cell_Start,Cell_End, Sorted_Pos, Sorted_Vel, Particle_Cell, Particle_Index, Old_Pos, Old_Vel, Num_Particles); </code></pre> <p>This error will cause your kernel to abort when it tries to access shared memory. You should also do <a href="https://stackoverflow.com/questions/14038589/what-is-the-canonical-way-to-check-for-errors-using-the-cuda-runtime-api">cuda error checking</a> on all cuda API calls and kernel calls. I don't see any evidence of that in your code.</p> <p>Once you have all the API errors sorted out, run your code with <code>cuda-memcheck</code>. The reason for the unexpected writes to <code>Particle_Cell</code> may be due to out-of-bounds accesses from your kernel, which will become evident with <code>cuda-memcheck</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload