Convey vector example: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m Added link to relavent section of programmer's guide |
||
Line 1: | Line 1: | ||
Note | The following is a short example on loop unrolling; for more information, see section 5 of the [[Media:ConveyProgrammersGuide.pdf | Convey Programmers Guide (.pdf)]]. | ||
Note that [[Team Slytherin]] (author) are having difficulty running this example. | |||
Convey allows you to write c/c++ or fortran code that is compiled to run on the co-processor. This is done by changing loops into vector opererations. Below is an example of a function that can be compiled to run with the co-processor | Convey allows you to write c/c++ or fortran code that is compiled to run on the co-processor. This is done by changing loops into vector opererations. Below is an example of a function that can be compiled to run with the co-processor |
Latest revision as of 17:19, 14 February 2012
The following is a short example on loop unrolling; for more information, see section 5 of the Convey Programmers Guide (.pdf).
Note that Team Slytherin (author) are having difficulty running this example.
Convey allows you to write c/c++ or fortran code that is compiled to run on the co-processor. This is done by changing loops into vector opererations. Below is an example of a function that can be compiled to run with the co-processor
void SimpleVectorAdder(int x[], int y[], int n){ int i; #pragma cny begin_coproc for(i = 0; i < n; i++){ x[i] = x[i] + y[i]; } #pragma cny end_coproc }
or
void SimpleVectorAdder(int x[], int y[], int n){ #pragma cny dual_target int i; for(i = 0; i < n; i++){ x[i] = x[i] + y[i]; } }