Accelerating Applications With Pattern-Specific Optimizations On Accelerators And Coprocessors