This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
ffnamespace:tutorial [2014/09/17 11:50] torquati [The basic] |
ffnamespace:tutorial [2015/09/08 14:54] torquati |
||
---|---|---|---|
Line 5: | Line 5: | ||
* [[http://calvados.di.unipi.it/storage/tutorial/html/tutorial.html|Single HTML file]] (version August 2014) | * [[http://calvados.di.unipi.it/storage/tutorial/html/tutorial.html|Single HTML file]] (version August 2014) | ||
- | * [[http://calvados.di.unipi.it/storage/tutorial/fftutorial.pdf|PDF file]] (version August 2014) | + | * [[http://calvados.di.unipi.it/storage/tutorial/fftutorial.pdf|PDF file]] (version September 2014) |
- | * [[http://calvados.di.unipi.it/storage/tutorial/fftutorial_source_code.tgz | Tests and examples - source code tarball]] (version August 2014) | + | * [[http://calvados.di.unipi.it/storage/tutorial/fftutorial_source_code.tgz | Tests and examples - source code tarball]] (version September 2014) |
===== Very short Tutorial ===== | ===== Very short Tutorial ===== | ||
Line 49: | Line 49: | ||
}; | }; | ||
int main() { | int main() { | ||
- | ff_pipe<fftask_t> pipe(new firstStage, secondStage, new thirdStage); | + | ff_Pipe<> pipe(make_unique<firstStage>(), |
- | pipe.cleanup_nodes(); // cleanup at exit | + | make_unique<ff_node_F<fftask_t> >(secondStage), |
+ | make_unique<thirdStage>()); | ||
if (pipe.run_and_wait_end()<0) error("running pipe"); | if (pipe.run_and_wait_end()<0) error("running pipe"); | ||
return 0; | return 0; | ||
Line 112: | Line 113: | ||
As an example, considering the [[http://en.wikipedia.org/wiki/Strassen_algorithm |Strassen's algorithm]] described by the following sequence of instructions operating on (sub-)matrices : | As an example, considering the [[http://en.wikipedia.org/wiki/Strassen_algorithm |Strassen's algorithm]] described by the following sequence of instructions operating on (sub-)matrices : | ||
- | S1 = A11 + A22, S2 = B11 + B22, S3 = A21 + A22, S4 = B12 - B22, S5 = B21 - B11, | + | S1 = A11 + A22; S2 = B11 + B22; S3 = A21 + A22; S4 = B12 - B22; S5 = B21 - B11; |
- | S6 = A11 + A12, S7 = A21 - A11, S8 = B11 + B12, S9 = A12 - A22, S10 = B21 + B22, | + | S6 = A11 + A12; S7 = A21 - A11; S8 = B11 + B12; S9 = A12 - A22; S10 = B21 + B22; |
- | P1 = S1 * S2, P2 = S3 * B11, P3 = A11 * S4, P4 = A22 * S5, P5 = S6 * B22, P6 = S7 * S8, P7 = S9*S10 | + | P1 = S1 * S2; P2 = S3 * B11; P3 = A11 * S4; P4 = A22 * S5; P5 = S6 * B22; P6 = S7 * S8; P7 = S9*S10 |
- | C11 = P1 + P4 - P5 + P7, C12 = P3 + P5, C21 = P2 + P4, C22 = P1 - P2 + P3 + P6 | + | C11 = P1 + P4 - P5 + P7; C12 = P3 + P5; C21 = P2 + P4; C22 = P1 - P2 + P3 + P6; |
the resulting DAG is sketched in the following figure: | the resulting DAG is sketched in the following figure: |