source:
CIVL/examples/opencl/2.15/vectorAdd.cvl@
83af34d
| Last change on this file since 83af34d was 6317abc, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 285 bytes | |
| Rev | Line | |
|---|---|---|
| [cc87898] | 1 | |
| 2 | void vectorAdd(__global const float *x, | |
| 3 | __global const float *y, | |
| 4 | __global 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 | } | |
| 12 |
Note:
See TracBrowser
for help on using the repository browser.
