I am currently implementing Dijkstra's algorithm in cuda and I want to know the previous of a node currently updating distance code looks like this
int dstwt = dist[dst];
int altdist = dist[src] + wt;
if(altdist < dstwt)
{
atomicMin(&dist[dst], altdist);
}
Here if dist[dst] gets updated prev[dst] must be updated to src but this has to be atomic operation I am not able to find such a atomic operation?