cuda lock

Solutions on MaxInterview for cuda lock by the best coders in the world

showing results for - "cuda lock"
Aoife
07 Jan 2019
1//d_lock must be initialized to 0
2bool success = false;
3while(!success) {
4  if (atomicCAS(&d_lock[i], 0, 1) == 0) {
5
6    //critical section
7    
8	success = true;
9    atomicExch(&d_lock[i], 0);
10  }
11}
queries leading to this page
cuda lockscuda lock