I want to know if this is possible to do... I want to check inside of the kernel in java, if the array contains numbers and characters, and if yes, save how many times they appear in the output array.
private static String programSource =
"__kernel void sampleKernel(__global const char *a, __global int *c){" +
" c[0]=0; c[1]=0;"+
" int gid = get_global_id(0);" +
" if((a[gid] > 64 && a[gid] < 91) || (a[gid] > 96 && a[gid] < 123)) c[0]+=1; "+
" else if(a[gid] > 47 && a[gid] < 58) c[1]+=1;" +
"}";
This is the code I have... but in the output array it always the number 1... What is wrong? What would be the solution for this problem?
Thanks!