source:
CIVL/examples/translation/openclversion2/vecadd/vectorAdd.cvl@
764d472
| Last change on this file since 764d472 was 4246e94, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 205 bytes | |
| Rev | Line | |
|---|---|---|
| [4246e94] | 1 | |
| 2 | void vectorAdd(const float *x, | |
| 3 | const float *y, | |
| 4 | float *restrict z) | |
| 5 | { | |
| 6 | // get index of the work item | |
| 7 | int index = get_global_id(0); | |
| 8 | ||
| 9 | // add the vector elements | |
| 10 | z[index] = x[index] + y[index]; | |
| 11 | } |
Note:
See TracBrowser
for help on using the repository browser.
