Skip to main content

LLVM Based Parallelization of C Programs for GPU

  • Conference paper
  • First Online:
Supercomputing (RuSCDays 2020)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 1331))

Included in the following conference series:

Abstract

The paper proposes an approach to semi-automatic program parallelization in SAPFOR (System FOR Automated Parallelization). SAPFOR proposes opportunities to perform user-guided source-to-source program transformations and to reveal implicit parallelism in sequential programs. The LLVM compiler infrastructure is used to examine a program and Clang is used to perform source-to-source program transformation. This paper highlights benefits of IR-level (Intermediate Representation) program analysis which allows us to apply low-level program transformations to investigate properties of the original program. To exploit program parallelism SAPFOR relies on DVMH which is a directive-based programming model. We use subset of C-DVMH language which allows us to run parallel program on GPU as well on multiprocessors. Evaluation of presented approach has been performed using the C version of the NAS Parallel Benchmarks.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Konovalov, N.A., Krukov, V.A., Mikhajlov, S.N., Pogrebtsov, A.A.: Fortan DVM: a language for portable parallel program development. Program. Comput. Softw. 21(1), 35–38 (1995)

    MATH  Google Scholar 

  2. Bakhtin, V.A., Klinov, M.S., Krukov, V.A., Podderugina, N.V., Pritula, M.N., Sazanov, Yu.L.: Extension of the DVM-model of parallel programming for clusters with heterogeneous nodes. Bull. South Ural State Univ. Ser. Math. Model. Program. Comput. Softw. 18(277)(12), 82–92 (2012). (in Russian)

    Google Scholar 

  3. Ragan-Kelley, J., Barnes, C., Adams, A., Paris, S., Durand, F., Amarasinghe, S.P.: Halide: a language and compiler for optimizing parallelism, locality, and recomputation in image processing pipelines. In: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2013, pp. 519–530 (2013)

    Google Scholar 

  4. Beaugnon, U., et al.: VOBLA: a vehicle for optimized basic linear algebra. In: Proceedings of the 2014 SIGPLAN/SIGBED Conference on Languages, Compilers and Tools for Embedded Systems, LCTES 2014, New York, NY, USA, pp. 115–124 (2014)

    Google Scholar 

  5. Zhang, Y., Yang, M., Baghdadi, R., Kamil, S., Shun, J., Amarasinghe, S.: Graphit: a high-performance graph DSL. In: Proceedings of the ACM on Programming Languages, vol. 2, no. OOPSLA, pp. 121:1–121:30 (2018)

    Google Scholar 

  6. Grosser, T., Groesslinger, A., Lengauer, C.: Polly-performing polyhedral optimizations on a low-level intermediate representation. Parallel Process. Lett. 22(04), 1250010 (2012)

    Article  MathSciNet  Google Scholar 

  7. Grosser, T., Hoefler, T.: Polly-ACC transparent compilation to heterogeneous hardware. In: ICS 2016: Proceedings of the 2016 International Conference on Supercomputing, June 2016, pp. 1–13 (2016). https://doi.org/10.1145/2925426.2926286

  8. Zhao, B., Li, Z., Jannesari, A., Wolf, F., Wu, W.: Dependence-based code transformation for coarse-grained parallelism. In: Proceedings of the International Workshop on Code Optimisation for Multi and Many Cores, San Francisco, CA, USA, pp. 1:1–1:10. ACM, February 2015

    Google Scholar 

  9. Kim, M., Kim, H., Luk, C.-K.: Prospector: a dynamic data-dependence profiler to help parallel programming. In: 2nd USENIX Workshop on Hot Topics in Parallelism (HotPar 2010) (2010)

    Google Scholar 

  10. Garcia, S., Jeon, D., Louie, C., Taylor, M.B.: Kremlin: rethinking and rebooting gprof for the multicore age. ACM SIGPLAN Not. (2011). https://doi.org/10.1145/1993316.1993553

  11. Hwu, W.-M., et al.: Implicitly parallel programming models for thousand-core microprocessors. In: Proceedings of the 44th Annual Design Automation Conference (DAC 2007), pp. 754–759. ACM, New York (2007). https://doi.org/10.1145/1278480.1278669

  12. Vandierendonck, H., Rul, S., De Bosschere, K.: The Paralax infrastructure: automatic parallelization with a helping hand. In: 2010 19th International Conference on Parallel Architectures and Compilation Techniques (PACT). IEEE (2010)

    Google Scholar 

  13. Klinov, M.S., Krukov, V.A.: Automatic parallelization of Fortran programs. Mapping to cluster. In: Vestnik of Lobachevsky University of Nizhni Novgorod, no. 2, pp. 128–134. Nizhni Novgorod State University Press (2009). (in Russian)

    Google Scholar 

  14. Kataev, N., Smirnov, A., Zhukov, A.: Dynamic data-dependence analysis in SAPFOR. In: CEUR Workshop Proceedings, vol. 2543, pp. 199–208 (2020)

    Google Scholar 

  15. Lattner, C., Adve, V.: LLVM: a compilation framework for lifelong program analysis & transformation. In: Proceedings of the 2004 International Symposium on Code Generation and Optimization (CGO 2004), Palo Alto, California (2004)

    Google Scholar 

  16. Kataev, N.: Application of the LLVM compiler infrastructure to the program analysis in SAPFOR. In: Voevodin, V., Sobolev, S. (eds.) RuSCDays 2018. CCIS, vol. 965, pp. 487–499. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-05807-4_41

    Chapter  Google Scholar 

  17. Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.: Compilers: Principles, Techniques, and Tools, 2nd edn. Addison Wesley, Boston (2006). p. 1038, Chap. 9

    MATH  Google Scholar 

  18. OpenMP Application Programming Interface. https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5.0.pdf. Accessed 14 Apr 2020

  19. Seo, S., Jo, G., Lee, J.: Performance characterization of the NAS parallel benchmarks in OpenCL. In: 2011 IEEE International Symposium on Workload Characterization (IISWC), pp. 137–148 (2011)

    Google Scholar 

  20. NAS Parallel Benchmarks. https://www.nas.nasa.gov/publications/npb.html. Accessed 14 Apr 2020

  21. Ernst, M.D., Badros, G.J., Notkin, D.: An empirical analysis of C preprocessor use. IEEE Trans. Software Eng. 28(12), 1146–1170 (2002). https://doi.org/10.1109/TSE.2002.1158288

    Article  Google Scholar 

  22. Havlak, P., Kennedy, K.: An implementation of interprocedural bounded regular section analysis. IEEE Trans. Parallel Distrib. Syst. 2(3), 350–360 (1991). https://doi.org/10.1109/71.86110

    Article  Google Scholar 

  23. Goff, G., Kennedy, K., Tseng, C.-W.: Practical dependence testing. In: Proceedings of the ACM SIGPLAN 1991 Conference on Programming Language Design and Implementation (PLDI 1991), pp. 15–29. ACM, New York (1991). https://doi.org/10.1145/113446.113448

  24. Kataev, N., Vasilkin, V.: Reconstruction of multi-dimensional arrays in SAPFOR. In: CEUR Workshop Proceedings, vol. 2543, pp. 209–218 (2020)

    Google Scholar 

  25. Bondhugula, U., Hartono, A., Ramanujam, J., Sadayappan, P.: A practical automatic polyhedral parallelizer and locality optimizer. SIGPLAN Not. 43(6), 101–113 (2008)

    Article  Google Scholar 

  26. Caamano, J.M.M., Sukumaran-Rajam, A., Baloian, A., Selva, M., Clauss, P.: APOLLO: automatic speculative polyhedral loop optimizer. In: 7th International Workshop on Polyhedral Compilation Techniques (IMPACT), Stockholm, Sweden, January 2017 (2017)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nikita Kataev .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Kataev, N. (2020). LLVM Based Parallelization of C Programs for GPU. In: Voevodin, V., Sobolev, S. (eds) Supercomputing. RuSCDays 2020. Communications in Computer and Information Science, vol 1331. Springer, Cham. https://doi.org/10.1007/978-3-030-64616-5_38

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-64616-5_38

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-64615-8

  • Online ISBN: 978-3-030-64616-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics