Abstract

Despite C/C++ and Python both being very popular programming languages, each tool possesses unique advantages and disadvantages. Notably, computers can run C/C++ code very quickly, but C/C++ code has to first be compiled and the syntax can be difficult for new programmers to understand. Python code, however, sacrifices speed for an easy-to-understand syntax and can be run interactively. Thankfully, it is possible to combine the benefits of Python and C/C++. For example, NumPy is a popular package of linear algebra operations written in C but used with Python. Such a combination allows programmers to not only utilize the fast speeds of C code but also Python's simple syntax. NumPy's potential, however, is limited by its inability to run on graphics processing units (GPUs), processors specialized for handling computations. On the other hand, a linear algebra library known as Matrix Algebra on GPU and Multicore Architectures (MAGMA) is suited for running its code on GPUs. Coupled with the fact that its code is written in C/C++, MAGMA offers extremely fast computations. To combine MAGMA's speed with Python's easy-to-understand syntax, we researched how to use C++ code with Python. By researching a tool known as Simplified Wrapper and Interface Generator (SWIG), we created PyMAGMA - a library of chosen MAGMA functions which can be imported in Python 3.9 for use.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call