Skip to Main Content
OpenCL is now available on a very large set of processors. This makes this language an attractive layer to address multiple targets with a single code base. The question on how sensitive to the underlying hardware is the OpenCL code in practice remains to be better understood. 1. This paper studies how realistic it is to use a unique OpenCL code for a set of hardware co-processors with different underlying micro-architectures. In this work, we target Intel® Xeon Phi™, NVIDIA® K20C and AMD® 7970™ GPU. All these accelerators provide at least support for OpenCL 1.1 and fit in the same high-end version of accelerator technology. To assess performance, we use OpenACC CAPS compiler to generate OpenCL code and use a moderately complex miniapplication, Hydro. This code uses 22 OpenCL kernels and was tailored to limit data transfers between the host and the accelerator device. To study how stable are the performance, we performed many experiments to determine the best OpenCL code for each hardware platform. This paper shows that, if well chosen, a single version of the code can be executed on multiple platforms without significant performance losses (less than 12%). This study confirms the need for auto-tuning technology to look for performance tradeoffs but also shows that deploying selftuning/adaptive code is not always necessary if the ultimate performance is not the goal.