I am a bit confused about synchronization.
- Using
__syncthreadsyou can synchronize threads in a block.This, (the use of__syncthreads) must be done only with shared memory? Or using shared memory with__syncthreadshas best performance? - Generally, threads may only safely communicate with each other if and only if they exist within the same thread block, right? So, why don't we always use shared memory? Because it's not big enough? And, if we don't use shared memory how can we ensure that results are right?
- I have a program that sometimes runs ok (I get the results) and sometimes i get 'nan' results without altering anything. Can that be a problem of synchronization?