Mali OpenCL SDK v1.1.0
 All Classes Files Functions Variables Macros Pages
hello_world_opencl.cl
Go to the documentation of this file.
1 /*
2  * This confidential and proprietary software may be used only as
3  * authorised by a licensing agreement from ARM Limited
4  * (C) COPYRIGHT 2013 ARM Limited
5  * ALL RIGHTS RESERVED
6  * The entire notice above must be reproduced on all authorised
7  * copies and copies may only be made to the extent permitted
8  * by a licensing agreement from ARM Limited.
9  */
10 
17 /* [OpenCL Implementation] */
18 __kernel void hello_world_opencl(__global int* restrict inputA,
19  __global int* restrict inputB,
20  __global int* restrict output)
21 {
22  /*
23  * Set i to be the ID of the kernel instance.
24  * If the global work size (set by clEnqueueNDRangeKernel) is n,
25  * then n kernels will be run and i will be in the range [0, n - 1].
26  */
27  int i = get_global_id(0);
28 
29  /* Use i as an index into the three arrays. */
30  output[i] = inputA[i] + inputB[i];
31 }
32 /* [OpenCL Implementation] */