I tried to accelerate my program using CUDA. Routine listed below should calculate a cost of a route:
The same routine on the CPU called in a cycle fills y array with costs. On the GPU this routine fills array with -431602080 values. When I reduce number of “for” cycle steps to 20 sometimes I have correct costs in some elements of y, but in other elements I have -35659499650496332000 values and #QNAN0’s. Could somebody explain what is happening?