https://www.cs.ualberta.ca/system/files/tech_report/2011/GargAmaralGPU-TR.pdf