Skip to main content
Log in

Compiler support for general-purpose computation on GPUs

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

In recent years, the GPU (graphics processing unit) has evolved into an extremely powerful and flexible processor, with it now representing an attractive platform for general-purpose computation. Moreover, changes to the design and programmability of GPUs provide the opportunity to perform general-purpose computation on a GPU (GPGPU). Even though many programming languages, software tools, and libraries have been proposed to facilitate GPGPU programming, the unusual and specific programming model of the GPU remains a significant barrier to writing GPGPU programs. In this paper, we introduce a novel compiler-based approach for GPGPU programming. Compiler directives are used to label code fragments that are to be executed on the GPU. Our GPGPU compiler, Guru, converts the labeled code fragments into ISO-compliant C code that contains appropriate OpenGL and Cg APIs. A native C compiler can then be used to compile it into the executable code for GPU. Our compiler is implemented based on the Open64 compiler infrastructure. Preliminary experimental results from selected benchmarks show that our compiler produces significant performance improvements for programs that exhibit a high degree of data parallelism.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Architecture review board, O, Shreiner D, Woo M, Neider J, Davis T (2003) OpenGL programming guide: the official guide to learning OpenGL, 4 edn. Addison-Wesley, Reading

    Google Scholar 

  2. Bhatt AV (2008) Creating a PCI express interconnect. Online available at www.pcisig.com/specifications/pciexpress/technical_library/pciexpress_whitepaper.pdf

  3. Bison (2008) Gnu parser generator. Website. Online available at http://www.gnu.org/software/bison/

  4. Brookgpu (2008) Website. Online available at http://graphics.stanford.edu/projects/brookgpu/

  5. Buck I, Foley T, Horn D, Sugerman J, Fatahalian K, Houston M, Hanrahan P (2004) Brook for gpus: Stream computing on graphics hardware. In: SIGGRAPH ’04: ACM SIGGRAPH 2004 Papers, New York, NY, USA, 2004. ACM, New York, pp 777–786

    Chapter  Google Scholar 

  6. Flex (2008) The fast lexical analyzer. Website. Online available at http://flex.sourceforge.net/

  7. GPGPU (2008) General-purpose computation using graphics hardware. Website. Online available at http://www.gpgpu.org/

  8. Galoppo N, Govindaraju NK, Henson M, Manocha D (2005) Lu-gpu: Efficient algorithm for solving dense linear systems on graphics hardware. In: ACM/IEEE super computing conference, 2005

  9. Gress A, Zachmann G (2006) Gpu-abisort: Optimal parallel sorting on stream architectures. In: International parallel and distributed processing symposium (IPDPS), 2006

  10. Hall JD, Carr NA, Hart JC (2003) Cache and bandwidth aware matrix multiplication on the gpu. Technical report, UIUCDCS-R-2003-2328, University of Illinois at Urbana-Champaign, April 2003. Online available at ftp://ftp.cs.uiuc.edu/pub/dept/tech_reports/2003/UIUCDCS-R-2003-2328.ps.gz

  11. Harris M (2005) GPU Gems 2: programming techniques for high-performance graphics and general-purpose computation. Addison-Wesley, Reading. Chapter 31: Mapping Computational Concepts to GPUs

    Google Scholar 

  12. Kilgariff E, Fernando R (2005) GPU Gems 2: programming techniques for high-performance graphics and general-purpose computation. Addison-Wesley, Reading. Chapter 30: The GeForce 6 Series GPU Architecture

    Google Scholar 

  13. Lefohn A, Kniss J, Owens J (2005) GPU Gems 2: programming techniques for high-performance graphics and general-purpose computation. Addison-Wesley, Reading. Chapter 33: Implementing Efficient Parallel Data Structures on GPUs

    Google Scholar 

  14. Mark WR, Glanville RS, Akeley K, Kilgard MJ (2003) Cg: A system for programming graphics hardware in a c-like language. In: SIGGRAPH ’03: ACM SIGGRAPH 2003 Papers, New York, NY, USA, 2003. ACM, New York, pp 896–907

    Chapter  Google Scholar 

  15. McCool M, Toit SD (2004) Metaprogramming GPUs with Sh. AK Peters, Wellesley

    Google Scholar 

  16. McCool MD, Qin Z, Popa TS (2002) Shader metaprogramming. In: HWWS ’02: Proceedings of the ACM SIGGRAPH/EUROGRAPHICS conference on graphics hardware, Aire-la-Ville, Switzerland, 2002, Eurographics Association, pp 57–68

  17. McCormick P, Inman J, Ahrens J, Mohd-Yusof J, Roth G, Cummins S (2007) Scout: a data-parallel programming language for graphics processors. Parallel Comput 33(10–11):648–662

    Google Scholar 

  18. McMahon F (2008) Livermore benchmark. Online available at http://www.netlib.org/benchmark/livermore

  19. Microsoft (2008) DirectX: high-level shading language. Website. Online available at http://www.microsoft.com/windows/directx

  20. Microsoft (2008) Directx: multimedia application programming interfaces. Website. Online available at http://www.microsoft.com/windows/directx/default.mspx

  21. NVIDIA (2008) Cg homepage. Website. Online available at http://developer.nvidia.com/page/cg_main.html

  22. NVIDIA (2008) NVIDIA CUDA homepage. Website. Online available at http://developer.nvidia.com/object/cuda.html

  23. Owens JD, Luebke D, Govindaraju N, Harris M, Kriiger J, Lefohn AE, Purcell TJ (2005) A survey of general-purpose computation on graphics hardware. In: Eurographics 2005, state of the art reports, August 2005, pp 21–51

  24. Peeper C (2008) Introduction to the directx 9 high-level shader language. Website. Online available at http://msdn2.microsoft.com/en-us/library/ms810449.aspx

  25. Peercy M, Segal M, Gerstmann D (2006) A performance-oriented data parallel virtual machine for gpus. In: SIGGRAPH ’06: ACM SIGGRAPH 2006 Sketches, New York, NY, USA, 2006. ACM, New York, p 184

    Chapter  Google Scholar 

  26. Robert PC, Schoepke S, Bieri H (2007) Hybrid ray tracing—ray tracing using gpu-accelerated image-space methods. In: GRAPP (GM/R), 2007, pp 305–311

  27. Stallman RM, the GCC Developer Community (2008) GNU compiler collection internals. GNU Press, Boston. Online available at http://gcc.gnu.org/onlinedocs

    Google Scholar 

  28. Stallman RM, the GCC Developer Community (2008) Using the GNU compiler collection. GNU Press, Boston. Online available at http://gcc.gnu.org/onlinedocs

    Google Scholar 

  29. Tarditi D, Puri S, Oglesby J (2006) Accelerator: using data parallelism to program gpus for general-purpose uses. In: The 12th international conference on architectural support for programming languages and operating systems, San Jose, California, USA, October 2006, pp 57–68

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Peng-Sheng Chen.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Lin, YT., Chen, PS. Compiler support for general-purpose computation on GPUs. J Supercomput 50, 78–97 (2009). https://doi.org/10.1007/s11227-008-0252-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-008-0252-7

Keywords

Navigation