GPU: L3 Part 2: CUDA Synchronization
CHEKKALA SANDEEP REDDY: yes VIPIN PATEL: yes CHEKKALA SANDEEP REDDY: deadlock Abhishek u: volatile reads and writes are slow Harshil Kassamkuttiyil: what happens when both threads run at the same time ? Abhishek u: livelock? CHEKKALA SANDEEP REDDY: satarving ?? CHEKKALA SANDEEP REDDY: Thread will starve, if there is no other thread to change to victim R Sowmeya Lakshmi: in lock while checks if victim==me and victim=me is set before going to while loop hence any thread trying to lock will be stuck there itself right Chinmay Rajesh Ingle: can you explain again what is Volatile variable ? Sayan Dey: why in unlock() phase, victim=me; again? Chinmay Rajesh Ingle: okay sir got it! CHEKKALA SANDEEP REDDY: No race CHEKKALA SANDEEP REDDY: Because thread Abhishek u: there is a race Chinmay Rajesh Ingle: 1 warp so x will be one? coz lock step Sayan Dey: 2,3,4 Abhishek u: updates are to global memory right CHEKKALA SANDEEP REDDY: there is a race VIPIN PATEL: The final value depend on the last writer CHEKKALA SANDEEP REDDY: 1 (or) 2 R Sowmeya Lakshmi: if old value is same we succeded CHEKKALA SANDEEP REDDY: if old_val is same as var Soumik Basu: atomicinc(flag) S; atomicdec(flag) R Sowmeya Lakshmi: while (atomicCAS(&var,x,y)!=x) CHEKKALA SANDEEP REDDY: lock = while(atomicCAS(&lock, lock = 1; Chinmay Rajesh Ingle: if the value of old is not CHEKKALA SANDEEP REDDY: thread divergence come CHEKKALA SANDEEP REDDY: into picture Chinmay Rajesh Ingle: okay CHEKKALA SANDEEP REDDY: in gpu ? Abhishek u: we can sync the local value and then check on the synced value to check ifexactly one has already executed. CHEKKALA SANDEEP REDDY: what does cudaMemset Sayan Dey: R Sowmeya Lakshmi: first printf will succeed suppose say for tid x , gg=x now and second printf will not succeed third printf will succeed for tid x+1 Abhishek u: it may be any thread in one of the warps Soumik Basu: can u please tell again what atomic Cas returns CHEKKALA SANDEEP REDDY: it will return old_val Abhishek u: its not required right? CHEKKALA SANDEEP REDDY: it will print the stamenet srikakolapu bhagavan: it may print if it is of the other block Soumik Basu: __syncthreads work within a block ? Soumik Basu: But here it is on global tid R Sowmeya Lakshmi: so change made by one thread in a block will not be visible to thread in another block? Abhishek u: sir, the data sync due to syncthreads is only for active threads right? Sayan Dey: sir, can you explain the difference b/w data sync and memory fence once more? CHEKKALA SANDEEP REDDY: Can you repeat again R Sowmeya Lakshmi: what does threadfence do Abhishek u: + Sayan Dey: addition, multiplication Chinmay Rajesh Ingle: Matrix mul Chinmay Rajesh Ingle: control sync would imply data sync if not why?(coz of data hierarchy?) Abhishek u: thank you sir. CHEKKALA SANDEEP REDDY: you are muted Chinmay Rajesh Ingle: okay sir thank you
Download
0 formatsNo download links available.