source: CIVL/examples/opencl/2.14/vecadd/vectorAdd.cl

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[cc87898]1// Copyright (C) 2013 Altera Corporation, San Jose, California, USA. All rights reserved.
2// Permission is hereby granted, free of charge, to any person obtaining a copy of this
3// software and associated documentation files (the "Software"), to deal in the Software
4// without restriction, including without limitation the rights to use, copy, modify, merge,
5// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to
6// whom the Software is furnished to do so, subject to the following conditions:
7// The above copyright notice and this permission notice shall be included in all copies or
8// substantial portions of the Software.
9//
10// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
12// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
14// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
15// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
16// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
17// OTHER DEALINGS IN THE SOFTWARE.
18//
19// This agreement shall be governed in all respects by the laws of the State of California and
20// by the laws of the United States of America.
21
22 // ACL kernel for adding two input vectors
23__kernel void vectorAdd(__global const float *x,
24 __global const float *y,
25 __global float *restrict z)
26{
27 // get index of the work item
28 int index = get_global_id(0);
29
30 // add the vector elements
31 z[index] = x[index] + y[index];
32}
33
Note: See TracBrowser for help on using the repository browser.