Functional Programming Libraries for Graphics Accelerators

Authors

DOI:

https://doi.org/10.14529/jsfi220403

Keywords:

C , functional programming library, CUDA, OpenMP, OpenCL, OpenACC

Abstract

Modern graphics accelerators (GPUs) can significantly speed up the execution of numerical tasks. However, porting programs to graphics accelerators is not an easy task, sometimes requiring their almost complete rewriting. CUDA graphics accelerators, thanks to the technology developed by NVIDIA, allow you to have a single source code for both conventional processors (CPUs) and graphics accelerators (CUDA). However, parallelization on shared memory is done differently and still must be specified explicitly. The use of the functional programming library developed by the authors makes it possible to hide the use of one or another parallelization mechanism on shared memory inside the library and make the user source code independent of the computing device used (CPU or CUDA). Functional programming is based on the modern mathematical theory, namely the Category Theory, in which the notions of Functors and Monads are widely used. Our work intensively utilizes these notions and extends them to grid expressions used in solving numerical problems.

References

TOP 500. https://www.top500.org

NVIDIA. https://www.nvidia.com

AMD. https://www.amd.com

TOP 50. http://top50.supercomputers.ru

OpenCL. https://www.khronos.org/opencl

OpenACC. https://www.openacc.org

CUDA Zone. https://developer.nvidia.com/cuda-zone

Haskell language. https://www.haskell.org

Chaplygin, A., Gusev, A., Diansky, N.: High-performance shallow water model for use on massively parallel and heterogeneous computing systems. Supercomputing Frontiers and Innovations 8(4), 74–93 (2021). https://doi.org/10.14529/jsfi210407

Coplien, J.O.: Curiously recurring template patterns. C++ Report pp. 24–27 (February 1995)

Feodoritova, O., Krasnov, M., Zhukov, V.: A numerical method for conjugate heat transfer problems in multicomponent flows. J. Phys.: Conf. Ser 2028 012024 (2021). https://doi.org/10.1088/1742-6596/2028/1/012024

Gorobets, A., Bakhvalov, P.: Heterogeneous CPU+GPU parallelization for high-accuracy scale-resolving simulations of compressible turbulent flows on hybrid supercomputers. Computer Physics Communications 271(108231) (February 2022). https://doi.org/10.1016/j.cpc.2021.108231

Gorobets, A., Duben, A.: Technology for supercomputer simulation of turbulent flowsin the good new days of exascale computing. Supercomputing Frontiers and Innovations 8(4), 4–10 (2021). https://doi.org/10.14529/jsfi210401

Krasnov, M.M.: Functional programming library for C++. Programming and Computer Software 46, 330–340 (2020). https://doi.org/10.1134/S0361768820050047

MacLane, S.: Categories for the Working Matematitian. Springer (1998)

Milewski, B.: Category Theory for Programmers (2019), https://github.com/hmemcpy/milewski-ctfp-pdf/releases/download/v1.3.0/category-theory-for-programmers.pdf

Murty, C., Manna, P., Chakraborty, D.: Conjugate heat transfer analysis in high speed flows. Proceedings of Institution of Mechanical Engineers, Part G: Journal of Aerospace Engineering 227(10), 1672–1681 (2013). https://doi.org/10.1177/0954410012464920

Veldhuizen, T.: Expression templates. C++ Report 7(5), 26–31 (June 1995)

Downloads

Published

2022-12-30

How to Cite

Krasnov, M. M., & Feodoritova, O. B. (2022). Functional Programming Libraries for Graphics Accelerators. Supercomputing Frontiers and Innovations, 9(4), 28–37. https://doi.org/10.14529/jsfi220403