Fixing pitch bugs and adding cuda thread syncronization
Merge branch 'marco' of github.com:arashb/GPULabProj into marco