DOI QR코드

DOI QR Code

Automatic Optimization Methods for Image Processing Programs Using OpenCL

OpenCL을 이용한 이미지 처리 프로그램의 자동 최적화 방법

  • 신재호 (서울대학교 컴퓨터공학부) ;
  • 조강원 (서울대학교 컴퓨터공학부) ;
  • 이일구 (서울대학교 컴퓨터공학부) ;
  • 이재진 (서울대학교 컴퓨터공학부)
  • Received : 2016.10.12
  • Accepted : 2016.12.09
  • Published : 2017.03.15

Abstract

In this paper, we propose automatic OpenCL optimization techniques that offer the best performance for image processing programs on any hardware system. Developers should seek a proper way of parallelization and an appropriate work-group size for the architecture of target compute devices to achieve the best performance. However, testing potential devices to find them is both time-consuming and costly. Our techniques automatically set up hardware-optimized parallelization and find a suitable work-group size for the target device. Furthermore, using OpenCL does not always provide better performance in image processing. Hence, we also propose a way to automatically search for a threshold image size to allow image processing programs to decide whether or not to use OpenCL. Our findings demonstrate that out techniques improve the image processing performance significantly.

영상 장비가 발전하고 고화질 이미지의 사용량이 많아짐에 따라 이를 병렬화하여 빠르게 처리하는 방법이 많이 연구되고 있다. 본 논문은 OpenCL을 사용한 이미지 처리 프로그램이 하드웨어에 관계없이 최적의 성능을 내도록 하는 방법을 제시한다. OpenCL은 계산 디바이스의 아키텍처에 따라 적절한 병렬화 방법과 워크그룹 크기를 개발자가 실험을 통해 찾아야 한다. 하지만 이는 시간적, 자원적 한계가 있다. 본 논문에서는 대상 하드웨어에 최적화된 병렬화 방법과 워크그룹 크기를 프로파일링을 통해 자동으로 선택하는 방법을 제안한다. 또한 OpenCL을 사용한 이미지 처리는 입력 이미지의 크기에 따라 순차코드 보다 성능이 좋을 수도 있고 안좋을 수도 있다. 본 논문에서는 OpenCL코드의 성능이 순차코드 성능보다 좋아지는 시점의 이미지 크기를 자동으로 검색하여 OpenCL을 사용할지 기존의 순차코드를 사용할지 결정하는 이미지 크기 threshold를 설정하는 방법을 제시한다. 이를 통해 이미지 처리 프로그램이 임의의 하드웨어에서 이미지 크기에 상관없이 항상 최적의 성능을 보이는 것을 확인했다.

Keywords

Acknowledgement

Supported by : 한국연구재단, 서울대학교

References

  1. OpenCL [Online], Available: https://www.khronos.org/opencl/
  2. A. Lee, J. Hong, K. Chung, "Non-uniform Work- group Allocation for Parallel Image Filter on Embedded GPU," Proc. of Symposium of the Korean Institute of Communications and Information Sciences, pp. 905-906, 2016. (in Korean)
  3. S. Seo, J. Lee, G. Jo, J. Lee, "Automatic OpenCL Work-Group Size Selection for Multicore CPUs," Proc. of the 22nd ACM/IEEE/IFIP International Conference on Parallel Architectures and Compilation Techniques, pp. 387-397, 2013.
  4. NVIDIA GeForce GTX 750 Ti Documentation [Online], Available: http://international.download.nvidia. com/geforce-com/international/pdfs/GeForce-GTX750-Ti-Whitepaper.pdf