Parallel patterns for heterogeneous CPU/GPU architectures: Structured parallelism from cluster to cloud