I found the solution by using thread.atomicAdd function, but is this function support float or double variables ??
because it is work fine with integer and give this error when I use for float
(33): error: no instance of overloaded function "atomicAdd" matches the argument list
argument types are: (float *, float)
I hope any one can give help for this and make this function support double variables it will be so helpful.
I will post the code soon ^_^