eyalroz/cuda-api-wrappers
Thin, unified, C++-flavored wrappers for the CUDA APIs
What it solves
This library addresses the deficiencies of NVIDIA's C-style CUDA APIs (Runtime and Driver APIs), which often require manual resource management, verbose error checking, and complex pointer-to-pointer patterns. It simplifies the process of interacting with the CUDA ecosystem, making the system more intuitive, consistent, and aligned with modern C++ programming practices.
How it works
It is a header-only C++ library that provides thin, lightweight wrappers around the core CUDA APIs, including the Driver API, Runtime API, NVRTC (dynamic compilation), NVTX (profiler API), and the PTX compiler library. It does not introduce new abstractions or force specific conventions, but rather rearranges the NVIDIA APIs into a modern C++ aesthetic.
Who it’s for
Developers who use CUDA APIs directly and want a more ergonomic, safer, and more composable way to interact with NVIDIA GPUs without sacrificing the full range of expression provided by the underlying APIs.
Highlights
- RAII Resource Management: Uses proxy objects for devices, streams, events, and kernels to automate resource release.
- Exception-based Error Handling: Replaces return-code checking with exceptions that carry status information.
- Improved Compositionality: Functions return the objects they produce rather than requiring pre-allocated out-parameters.
- Integrated API Access: Provides seamless integration between the Driver, Runtime, and NVRTC APIs.
- Zero-Overhead Design: A lightweight, header-only implementation with no costly inheritance or virtual methods, ensuring most wrappers vanish during compilation.
Related
- Project
- Project
- Project
- Project
- Project