NVIDIA / MatX

An efficient C++17 GPU numerical computing library with Python-like syntax

Home Page:https://nvidia.github.io/MatX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[QST] Consider refactoring above cuda-api-wrappers

eyalroz opened this issue · comments

I've noticed that MatX needs to include some CUDA-related abstractions and facilities (like error handling) which are actually not specific to matrix/tensor/numeric computations in any way.

I would suggest you consider building MatX on top of the Modern-C++ CUDA API wrappers library.

Benefits:

  • Reduction in the amount of code.
  • No more C-style coding of your use of the CUDA APIs - cleaner codebase for this library.
  • No having to worry about catching errors from CUDA API calls.
  • Less of a hassle when you want to add functionality relying on bits of CUDA you have not yet wrapped/instrumented - avoid artificial de-motivation from doing that.
  • Compatible license: BSD 3-clause.
  • Header-only library, so no need to compile anything
  • Easy to work with - via any of CMake find_package(), CMake FetchContent, just copying ("vendoring") the header files

Detriments:

  • Not an official NVIDIA library
  • Will increase translation unit size somewhat (but does not involve deep TMP voodoo)

Thanks @eyalroz! We will take a look to see how much code this will save and report back.

Wow, I'm surprised to have gotten a positive response, and this quickly... you may want to look at some example programs to see how the library is used. And - feel very free to chat me up about this.