OpenCL provides unified programming interface for various parallel computing platforms. The OpenCL framework manifests good functional portability, the programs can be run on platforms supporting OpenCL programming without any modification. However, most of the OpenCL programs are optimized for massively parallel processors, such as GPU, it's hard to achieve good performance on general multi-core processors without sophisticate modification to the GPU specific OpenCL programs. The major reason is the immense gap between CPU and GPU architecture. In this paper, we evaluate the performance portability of OpenCL programs between CPU and GPU, and analyse the reasons why GPU specific OpenCL programs are not fit for CPU. Based on the profiling, we proposed three optimization strategies for improving performance of GPU specific OpenCL programs on CPU, including increasing the granularity of task partition, optimizing the usage of memory hierarchy and block-based data accessing. In addition, we applied the proposed techniques on several benchmarks. The experimental results show that the performance of the optimized OpenCL programs achieve high performance in terms of speedup ratio from 2 to 4 on CPUs, when compared with their corresponding GPU specific ones.
[1]
Jack J. Dongarra,et al.
From CUDA to OpenCL: Towards a performance-portable solution for multi-platform GPU programming
,
2012,
Parallel Comput..
[2]
Timothy G. Mattson,et al.
OpenCL Programming Guide
,
2011
.
[3]
Rosa M. Badia,et al.
CellSs: a Programming Model for the Cell BE Architecture
,
2006,
ACM/IEEE SC 2006 Conference (SC'06).
[4]
Jaejin Lee,et al.
Performance characterization of the NAS Parallel Benchmarks in OpenCL
,
2011,
2011 IEEE International Symposium on Workload Characterization (IISWC).
[5]
Robert M. Farber,et al.
CUDA Application Design and Development
,
2011
.
[6]
Peter Mattson,et al.
A programming system for the imagine media processor
,
2002
.
[7]
William Thies,et al.
StreamIt: A Language for Streaming Applications
,
2002,
CC.