Extracting heterogeneous parallelism from high-level array-based languages