Program transformation and code generation for developing, modeling, and optimizing GPU programs