Note that there are some explanatory texts on larger screens.

plurals
  1. POPorting a program to CUDA - kernel inside another kernel?
    primarykey
    data
    text
    <p>I am trying to parallelize a function that contains several procedures. The function goes:</p> <pre><code>void _myfunction(M1,M2){ for (a = 0; a &lt; A; a++) { Amatrix = procedure1(M1) /*contains for loops*/; Bmatrix = procedure2(M1) /*contains for loops*/; ... for ( z = 1 ; z &lt; Z ; z++ ){ calculations with Amatrix(z) and obtain AAmatrix calculations with Bmatrix(z) and obtain BBmatrix for ( e = 1; e &lt; E; e++) { calculations with AAmatrix(e) and obtain CCmatrix calculations with BBmatrix(e) and obtain DDmatrix } } for (q = 0; q &lt; Q; q++){ calculations with CCMatrix(q) } for (m = 0; m &lt; M; m++){ calculations with DDMatrix(q) } } } </code></pre> <p>Concerning the functions <code>procedure1()</code> and <code>procedure2()</code>, I have ported them to CUDA and everything is going fine (each of these procedures have their own for loops). The reason that these procedures are separated is because they are conceptually independent algorithms, opposite to the rest of the code that has a more general concept. </p> <p>Now I am trying to port the rest of the code to CUDA, but I am not sure about what to do. Of course, I want to keep the <strong>same structure</strong> of the entire function, if it is possible. My first thought was to transform the function <code>_myfunction(arg1,arg2,..)</code> into a kernel but my problem is that there are already two kernel function that are executed in order inside. Somewhere I have read that we can use streams, but again I am not sure how to do it and if it is correct. </p> <p><strong>Question:</strong> Can somebody give a hint on how to port a program to CUDA?</p> <p>P.S: I am using GeForce 9600GT (Compute Capability 1.1) and the CUDA Toolkit 5.0.</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.
 

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