OpenCL ignores kernel -


i'm familiarizing myself opencl. found simple example in internet.

the kernel is:

__kernel void vector_add(__global const int *a, __global const int *b, __global int *c)   {     // index of current element processed     int = get_global_id(0);     // operation     c[i] = a[i] + b[i]; } 

i compile , run it. result is:

0 + 1024 = 0 1 + 1023 = 0 2 + 1022 = 0 3 + 1021 = 0 4 + 1020 = 0 5 + 1019 = 0 6 + 1018 = 0 7 + 1017 = 0 8 + 1016 = 0 9 + 1015 = 0 10 + 1014 = 0 11 + 1013 = 0 12 + 1012 = 0 13 + 1011 = 0 14 + 1010 = 0 15 + 1009 = 0 16 + 1008 = 0 17 + 1007 = 0 18 + 1006 = 0 19 + 1005 = 0 20 + 1004 = 0 21 + 1003 = 0 22 + 1002 = 0 23 + 1001 = 0 24 + 1000 = 0 25 + 999 = 0 26 + 998 = 916789344 27 + 997 = 32756 28 + 996 = -1 29 + 995 = 0 ... 

i noticed not depend on *.cl file content. if change c[i] = a[i] + b[i]; on c[i] = 3.; result same. if remove kernel file - result same.

what can problem?

p.s. example, i'm trying compile, have found here: http://www.thebigblob.com/getting-started-with-opencl-and-gpu-computing/#comment-2575


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -