![]() |
ИСТИНА |
Войти в систему Регистрация |
ИСТИНА ЦЭМИ РАН |
||
We present a cross-platform approach to development of high performance software for both CPUs (via ISPC) and GPUs (via Vulkan) using a subset of common C++. An important difference of our technology with existing solutions is that we do not introduce any new language constructs or directives for parallel processing in to the language. Opposite to that we restrict language capabilities with a specific programming patterns and library calls thus making ``clean code'' also the high performance one. Unlike many other programming technologies, our solution doesn't make projects using it dependent on it: (1) the input code is a normal C++ code which can be processed with any existing C++11 compiler and also can use any directive-based technologies inside (for example, OpenMP); (2) the output code is a readable implementation of the same algorithm in ISPC or Vulkan which is intended to be worked with by replacing different virtual functions and kernels if needed. As a result, this approach has an important advantage over existing ones: even if we have a limited hardware support in our translator, user is not limited by these features. This is because optimizations could be manually added to the generated code, and our approach assumes user will do this in such a way that code re-generation will not break them. Therefore, we position our system as help for developers who need deep performance control and understanding (via careful analysis of the low level code) which usually forces them to use Vulkan on a GPU or ISPC on a CPU. Our translator takes a C++ class as input and generates output implementation as a derived class using source-to-source transformation via clang front-end. Therefore the generated code is trivially integrated with existing codebase by just replacing class pointer with the generated implementation. Finally, unlike many other solutions, our technology is not a black box for a user and also makes debugging transparent because it is easy to distinguish translator errors from the user's errors.