1. A method, comprising: affine partitioning code to generate affine partitioning mappings; and generating parallel code based on the affine partitioning mappings, wherein generating the parallel code includes: coalescing loops in the parallel code generated from the affine partitioning mappings to generate coalesced parallel code; and optimizing the coalesced parallel code.