Proceedings of the Institute for System Programming of the RAS
RUS  ENG    JOURNALS   PEOPLE   ORGANISATIONS   CONFERENCES   SEMINARS   VIDEO LIBRARY   PACKAGE AMSBIB  
General information
Latest issue
Archive

Search papers
Search references

RSS
Latest issue
Current issues
Archive issues
What is RSS



Proceedings of ISP RAS:
Year:
Volume:
Issue:
Page:
Find






Personal entry:
Login:
Password:
Save password
Enter
Forgotten password?
Register


Proceedings of the Institute for System Programming of the RAS, 2021, Volume 33, Issue 5, Pages 181–204
DOI: https://doi.org/10.15514/ISPRAS-2021-33(5)-11
(Mi tisp635)
 

This article is cited in 1 scientific paper (total in 1 paper)

Development in vulkan: a domain-specific approach

V. A. Frolovab, V. V. Sanzharovab, V. A. Galaktionovb, A. S. Shcherbakova

a Lomonosov Moscow State University
b Keldysh Institute of Applied Mathematics of Russian Academy of Sciences
Abstract: In this paper we propose a high-level approach to developing GPU applications based on the Vulkan API. The purpose of the work is to reduce the complexity of developing and debugging applications that implement complex algorithms on the GPU using Vulkan. The proposed approach uses the technology of code generation by translating a C++ program into an optimized implementation in Vulkan, which includes automatic shader generation, resource binding, and the use of synchronization mechanisms (Vulkan barriers). The proposed solution is not a general-purpose programming technology, but specializes in specific tasks. At the same time, it has extensibility, which allows to adapt the solution to new problems. For single input C++ program, we can generate several implementations for different cases (via translator options) or different hardware. For example, a call to virtual functions can be implemented either through a switch construct in a kernel, or through sorting threads and an indirect dispatching via different kernels, or through the so-called callable shaders in Vulkan. Instead of creating a universal programming technology for building various software systems, we offer an extensible technology that can be customized for a specific class of applications. Unlike, for example, Halide, we do not use a domain-specific language, and the necessary knowledge is extracted from ordinary C++ code. Therefore, we do not extend with any new language constructs or directives and the input source code is assumed to be normal C++ source code (albeit with some restrictions) that can be compiled by any C++ compiler. We use pattern matching to find specific patterns (or patterns) in C++ code and convert them to GPU efficient code using Vulkan. Pattern are expressed through classes, member functions, and the relationship between them. Thus, the proposed technology makes it possible to ensure a cross-platform solution by generating different implementations of the same algorithm for different GPUs. At the same time, due to this, it allows you to provide access to specific hardware functionality required in computer graphics applications. Patterns are divided into architectural and algorithmic. The architectural pattern defines the domain and behavior of the translator as a whole (for example, image processing, ray tracing, neural networks, computational fluid dynamics and etc.). Algorithmic pattern express knowledge of data flow and control and define a narrower class of algorithms that can be efficiently implemented in hardware. Algorithmic patterns can occur within architectural patterns. For example, parallel reduction, compaction (parallel append), sorting, prefix sum, histogram calculation, map-reduce, etc. The proposed generator works on the principle of code morphing. The essence of this approach is that, having a certain class in the program and transformation rules, one can automatically generate another class with the desired properties (for example, the implementation of the algorithm on the GPU). The generated class inherits from the input class and thus has access to all data and functions of the input class. Overriding virtual functions in generated class helps user to carefully connect generated code to the other Vulkan code written by hand. Shaders can be generated in two variants: OpenCL shaders for google “clspv” compiler and GLSL shaders for an arbitrary GLSL compiler. Clspv variant is better for code which intensively uses pointers and the GLSL generator is better if specific HW features are used (like hardware ray tracing acceleration). We have demonstrated our technology on several examples related to image processing and ray tracing on which we get 30-100 times acceleration over multithreaded CPU implementation.
Keywords: code generation, gPU programming, vulkan.
Funding agency Grant number
Russian Science Foundation 21-71-00037
This work is supported by the Russian Science Foundation (RSF) under grant #21-71-00037
Document Type: Article
Language: Russian
Citation: V. A. Frolov, V. V. Sanzharov, V. A. Galaktionov, A. S. Shcherbakov, “Development in vulkan: a domain-specific approach”, Proceedings of ISP RAS, 33:5 (2021), 181–204
Citation in format AMSBIB
\Bibitem{FroSanGal21}
\by V.~A.~Frolov, V.~V.~Sanzharov, V.~A.~Galaktionov, A.~S.~Shcherbakov
\paper Development in vulkan: a domain-specific approach
\jour Proceedings of ISP RAS
\yr 2021
\vol 33
\issue 5
\pages 181--204
\mathnet{http://mi.mathnet.ru/tisp635}
\crossref{https://doi.org/10.15514/ISPRAS-2021-33(5)-11}
Linking options:
  • https://www.mathnet.ru/eng/tisp635
  • https://www.mathnet.ru/eng/tisp/v33/i5/p181
  • This publication is cited in the following 1 articles:
    Citing articles in Google Scholar: Russian citations, English citations
    Related articles in Google Scholar: Russian articles, English articles
    Proceedings of the Institute for System Programming of the RAS
    Statistics & downloads:
    Abstract page:15
    Full-text PDF :28
     
      Contact us:
     Terms of Use  Registration to the website  Logotypes © Steklov Mathematical Institute RAS, 2024