Multicore and GPU Programming: An Integrated Approach