{"id":13645060,"url":"https://github.com/eyalroz/cuda-api-wrappers","last_synced_at":"2026-01-22T00:02:20.047Z","repository":{"id":37252642,"uuid":"73505627","full_name":"eyalroz/cuda-api-wrappers","owner":"eyalroz","description":"Thin, unified, C++-flavored wrappers for the CUDA APIs","archived":false,"fork":false,"pushed_at":"2026-01-11T23:24:02.000Z","size":3086,"stargazers_count":868,"open_issues_count":111,"forks_count":85,"subscribers_count":26,"default_branch":"master","last_synced_at":"2026-01-12T03:16:56.849Z","etag":null,"topics":["api-wrapper","cuda","cuda-api-wrappers","cuda-device","cuda-driver","cuda-driver-api","cuda-programming","cuda-runtime-api","cuda-toolkit","gpgpu","gpgpu-computing","gpu","gpu-computing","gpu-memory","modern-cpp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eyalroz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"patreon":"einpoklum","custom":"https://paypal.me/eyalroz"}},"created_at":"2016-11-11T19:31:08.000Z","updated_at":"2026-01-01T18:37:40.000Z","dependencies_parsed_at":"2023-10-16T09:48:04.640Z","dependency_job_id":"a8b2f0da-4a19-4c5f-a09f-7384253d583d","html_url":"https://github.com/eyalroz/cuda-api-wrappers","commit_stats":null,"previous_names":[],"tags_count":94,"template":false,"template_full_name":null,"purl":"pkg:github/eyalroz/cuda-api-wrappers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalroz%2Fcuda-api-wrappers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalroz%2Fcuda-api-wrappers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalroz%2Fcuda-api-wrappers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalroz%2Fcuda-api-wrappers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyalroz","download_url":"https://codeload.github.com/eyalroz/cuda-api-wrappers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalroz%2Fcuda-api-wrappers/sbom","scorecard":{"id":388767,"data":{"date":"2025-08-11","repo":{"name":"github.com/eyalroz/cuda-api-wrappers","commit":"67a68c2bc43fb1a4629a9d6c708566b168a3cf91"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/cmake-build-linux.yml:1","Warn: no topLevel permission defined: .github/workflows/cmake-build-windows.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":9,"reason":"0 commit(s) and 11 issue activity found in the last 90 days -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cmake-build-linux.yml:176: update your workflow using https://app.stepsecurity.io/secureworkflow/eyalroz/cuda-api-wrappers/cmake-build-linux.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/cmake-build-windows.yml:179: update your workflow using https://app.stepsecurity.io/secureworkflow/eyalroz/cuda-api-wrappers/cmake-build-windows.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'development'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T17:17:52.116Z","repository_id":37252642,"created_at":"2025-08-18T17:17:52.116Z","updated_at":"2025-08-18T17:17:52.116Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28647477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","cuda","cuda-api-wrappers","cuda-device","cuda-driver","cuda-driver-api","cuda-programming","cuda-runtime-api","cuda-toolkit","gpgpu","gpgpu-computing","gpu","gpu-computing","gpu-memory","modern-cpp"],"created_at":"2024-08-02T01:02:25.000Z","updated_at":"2026-01-22T00:02:20.026Z","avatar_url":"https://github.com/eyalroz.png","language":"C++","funding_links":["https://patreon.com/einpoklum","https://paypal.me/eyalroz"],"categories":["Concurrency","C++","CUDA"],"sub_categories":["Libraries"],"readme":"# Thin C++-flavored wrappers for the CUDA APIs:\u003cbr\u003e Runtime, Driver, NVRTC and more\n\n\u003c!--Branch Build Status: Master [![Master Build Status](https://api.travis-ci.com/eyalroz/cuda-api-wrappers.svg?branch=master)](https://travis-ci.com/eyalroz/cuda-api-wrappers) | Development: [![Development Build Status](https://api.travis-ci.com/eyalroz/cuda-api-wrappers.svg?branch=development)](https://travis-ci.com/eyalroz/cuda-api-wrappers) --\u003e\n\n[![Repository license](https://img.shields.io/badge/License-3BSD-blue.svg)](https://raw.githubusercontent.com/eyalroz/cuda-api-wrappers/master/LICENSE) \n[![Repository documentation](https://img.shields.io/badge/Documentation-CodeDocs-blue.svg)](https://codedocs.xyz/eyalroz/cuda-api-wrappers/) \n[![Linux build passing](https://github.com/eyalroz/cuda-api-wrappers/actions/workflows/cmake-build-linux.yml/badge.svg)](https://github.com/eyalroz/cuda-api-wrappers/actions/workflows/cmake-build-linux.yml) \n[![Windows build passing](https://github.com/eyalroz/cuda-api-wrappers/actions/workflows/cmake-build-windows.yml/badge.svg)](https://github.com/eyalroz/cuda-api-wrappers/actions/workflows/cmake-build-windows.yml)\n![Conan Center](https://img.shields.io/conan/v/cuda-api-wrappers)\n![Vcpkg Version](https://img.shields.io/vcpkg/v/cuda-api-wrappers)\n\n\n\n| Table of contents |\n|:------------------|\n|\u003csub\u003e[General description](#general-description)\u003cbr\u003e  - [Key features](#key-features)\u003cbr\u003e[Motivation](#motivation)\u003cbr\u003e[Requirements](#requirements)\u003cbr\u003e[Using the library in your project](#using-the-library-in-your-project)\u003cbr\u003e[Coverage of the APIs](#coverage-of-the-apis)\u003cbr\u003e[A taste of some features in play](#a-taste-of-some-features-in-play)\u003cbr\u003e[Example programs](#example-programs)\u003cbr\u003e  - [Modified CUDA samples](#modified-cuda-samples)\u003cbr\u003e  - ['Coverage' programs - by API module](#coverage-programs---by-api-module)\u003cbr\u003e[Want to help? Report a bug? Give feedback?](#want-to-help-report-a-bug-give-feedback)\u003c/sub\u003e|\n\n\n## General description\n\nThis is a header-only library of integrated wrappers around the core parts of NVIDIA's [CUDA](https://developer.nvidia.com/cuda-zone) execution ecosystem:\n\n* The lower-level [CUDA Driver API](http://docs.nvidia.com/cuda/cuda-driver-api/index.html)\n* The slightly higher-level CUDA [Runtime API](http://docs.nvidia.com/cuda/cuda-runtime-api/index.html)\n* NVIDIA's dynamic CUDA code compilation library, [NVRTC](http://docs.nvidia.com/cuda/nvrtc/index.html)\n* NVIDIA's out-of-driver, full-featured [PTX compiler library](https://docs.nvidia.com/cuda/ptx-compiler-api/index.html) (available since CUDA 11.1)\n* NVIDIA's fat binary creation library [nvFatbin](https://docs.nvidia.com/cuda/nvfatbin/index.html) (available since CUDA 12.4)\n* The NVIDIA profiler in-program API, also known as [NVTX](https://docs.nvidia.com/cuda/profiler-users-guide/index.html#nvtx) (the NVIDIA Toolkit Extensions library).\n\nIt is intended for those who would otherwise use these APIs directly, to make working with them be more intuitive and consistent, making use of modern C++ language capabilities, programming idioms and best practices. In a nutshell - making CUDA API work more fun :-)\n\nAlso, and importantly - while the wrappers seem to be \"high-level\", more \"abstract\" code - they are nothing more than a modern-C++-aesthetic arrangement of NVIDIA's own APIs. The wrapper library does not force any abstractions above CUDA's own, nor conventions regarding where to place data, how and when to perform synchronization, etc.; you have the complete range of expression of the underlying APIs.\n\n\n### Key features\n\nIn contrast to the above, this library provides:\n\n- **Seamlessly integrated functionality** of the Driver, Runtime and NVRTC API (NVTX doesn't integrate all that much, seamlessly or otherwise, but it's readily usable).\n- All functions and methods throw **exceptions** on failure, which carry status information; no need to check return values.\n- Methods and **functions return what they produce**, since they don't need to return a status code. No more having to pre-allocate result variables and pass pointers to them as out-parameters. Better compositionality!\n- Judicious **namespacing** (and some internal namespace-like classes) for clarity and for semantic grouping of related functionality.\n- There are **proxy/wrapper objects** for devices, streams, events, kernels, contexts, modules, link processes, timed intervals and so on - all using the [CADRe/RAII](http://en.cppreference.com/w/cpp/language/raii) convention; you don't have to remember to free or release your resources yourself.\n- You can **forget about numeric IDs and handles**; the proxy classes will fit everywhere. Of course, you can still get those numeric values for cooperation with other CUDA-related software.\n- Various [Plain Old Data](http://en.cppreference.com/w/cpp/concept/PODType) structs adorned with **convenience methods and operators** (e.g. device properties, block and grid dimensions).\n- Aims for **clarity and straightforwardness** in naming and semantics, so that you don't need to refer to the official documentation to understand what each class and function do.\n- Aims for conformance with the [C++ core guidelines](https://github.com/isocpp/CppCoreGuidelines).\n- **Header-only**: No need to compile anything special to use the library.\n- Thin and **lightweight**:\n    - No work done behind your back, no caches or indices or any such thing - with almost no exceptions. (Some do exist, though: Ensuring Runtime-API and Driver-API compatibility sometimes requires it; and there is also the matter of creating devices' primary context).\n    - No costly inheritance structure, vtables, virtual methods and so on, for almost all wrappers; they vanishes almost entirely on compilation.\n    - All \"Runtime-API level\" actions are implemented so as not to disrupt \"Driver-API-level\" work.\n- Permissive free software license: [3-BSD](https://github.com/eyalroz/cuda-api-wrappers/blob/master/LICENSE).\n\nThere is one noteworthy caveat: The wrapper API calls cannot make assumptions about previous or later code of yours, which means some of them require more calls to obtain the current context handle or push a(n existing) context, then pop it. While these calls are cheap, they are still non-trivial and can't be optimized away.\n\n## Motivation\n\nNVIDIA provides two main APIs for using [CUDA](https://developer.nvidia.com/cuda-zone): The Runtime API and the\nDriver API. These suffer from several deficiencies:\n\n* They are both C-style APIs, targeting the lowest common denominator of language facilities for abstraction, safety and ease of use.\n* ... although the Runtime API has a few [exceptions](https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__HIGHLEVEL.html), so you actually need to write C++ to use it.\n* The runtime API is supposedly the higher-level, more convenient version of the Driver API; in fact, it's missing a lot of important functionality, and can't be used in conjuction with other CUDA facilities, like the NVRTC dynamic compilation library. Consequently, you're forced to use _both_ the runtime and the driver API.\n* It is difficult to use both the runtime and driver API in conjuction; if you're not careful, you'll mess up things like the context stack.\n* The runtime API makes multiple assumptions which you might not want it to make.\n* You have to manually check every call to every API function, everywhere.\n* You have to work with pointers a lot, and pointers-to-pointers, since the API functions mostly return status codes rather than outputs; this will also prevent you from composing.\n* You will need to remember to release all resources you allocate or create - or else bad things happen.\n* There is a very large number of API functions, many of which are related, have similar names, and are easy to confuse.\n* You will be working with a lot of numeric and pointer-based handles, instead of class or structs. Other than the poor aesthetics, this makes it easy to mix up resource-handle and pure-number parameters to functions.\n\nYou may have noticed this list reads like the opposite of the [key features](#key-features), listed above: The idea is to make this library overcome and rectify all of these deficiencies as much as possible.\n\n\n## Requirements\n\n- CUDA: v11.x or later recommended, v9.0 or later supported.\n\n    Remember that an NVIDIA driver compatible with your CUDA version also needs to be installed. Typically, this can be the one bundled in your CUDA distribution itself.\n\n- Other software:\n     - A C++11-capable compiler compatible with your version of CUDA.\n     - CMake v3.25 or later; it's very easy to [download and install](https://cmake.org/download/) a recent version - no need to build it yourself.\n\n- An NVIDIA GPU supporting Unified Virtual Addressing (UVA), i.e. Fermi microarchitecture or later. With earlier GPUs, memory copying, and other functionality relying on automtically determining where a memory address is located, will fail.\n\n## Using the library in your project\n\n### Projects using CMake\n\nFor CMake, you have three alternatives for obtaining the library to use in your project:\n\n1. (apriori) Manually download a release tarball from the [Releases](https://github.com/eyalroz/cuda-api-wrappers/releases) page. Then, configure it with CMake, build it, and install it - to a place visible to cmake when it searches for packages (see [CMAKE_PREFIX_PATH](https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html)).\n3. (apriori) Use the [conan](https://conan.io) package management tool: Follow the instructions in the Conan tutorial on [Building a simple CMake project using Conan](https://docs.conan.io/2/tutorial/consuming_packages/build_simple_cmake_project.html), but instead of `zlib`, use `cuda-api-wrappers` with the version you're interested in. Briefly, you will need to create an appropriate `conanfile.txt` file; make sure you have a Conan profile; and use `conan install` to target your project's build directory. This will create a [CMake toolchain file](https://cmake.org/cmake/help/latest/variable/CMAKE_TOOLCHAIN_FILE.html) with which you actually build your project.\n2. (apriori) Use the [vcpkg](https://github.com/microsoft/vcpkg) package management tool:\n   ```bash\n   vcpkg install cuda-api-wrappers\n   ```\n3. (at config time) use CMake's `FetchContent` module to have CMake itself obtain the project source code and make it part of your own project's build, e.g.:\n   ```cmake\n   include(FetchContent)\n   FetchContent_Declare(cuda-api-wrappers_library\n       GIT_REPOSITORY https://github.com/eyalroz/cuda-api-wrappers.git\n       GIT_TAG v12.34.56 # Replace this with a real available version\n       OVERRIDE_FIND_PACKAGE\n   )\n   ```\nNow that you have the package, in your project's `CMakeLists.txt`, you write:\n```cmake\nfind_package(cuda-api-wrappers CONFIG REQUIRED)\n```\nThis will let you use three targets within the `cuda-api-wrappers::` namespace: `runtime-and-driver`, `nvrtc` and `nvtx`. For example:\n```cmake\ntarget_link_library(my_app cuda-api-wrappers::runtime-and-driver)\n```\n**Use not involving CMake:**\n\nSince this is a header-only library, you can simply add the `src/` subdirectory as one of your project's include directories. However, if you do this, it will be up to you to make sure and have the CUDA include directory in you include path as well, and to link against the CUDA driver, runtime API, NVRTC and/or NVTX libraries as appropriate.\n\n## Coverage of the APIs\n\nMost, but not quite all, API calls in the Runtime, Driver, NVTX and NVRTC are covered by these wrappers. You can find the main omissions as [issues tagged with \"missing-cuda-feature\"](https://github.com/eyalroz/cuda-api-wrappers/issues?q=is%3Aissue+is%3Aopen+label%3Amissing-cuda-feature), intended for further development work. Additionally, the wrapper library does not cover the APIs for interoperability with OpenGL, Direct3D, EGL and VDAPU.\n\nThe [Milestones](https://github.com/eyalroz/cuda-api-wrappers/milestones) indicates some features which aren't covered and are slated for future work. Since I am not currently working on anything graphics-related, there are no short-term plans to extend coverage to more graphics-related APIs; however - PRs are welcome.\n\n## A taste of some features in play\n\nDon't you wish you were able to type in, say:\n```cpp\nauto callback =\t[\u0026foo] { std::cout \u003c\u003c \"Hello \" \u003c\u003c foo \u003c\u003c \" world!\\n\"; }\nmy_stream.enqueue.host_invokable(callback);\n```\n... and have that just work? And don't you wish CUDA API invocations could be plain and straightforward one-liners? Like this sequence?\n```cpp\nauto compilation_output = my_program.compile();\nauto module = cuda::module::create(context, compilation_output);\nauto my_kernel = module.get_kernel(mangled_kernel_name);\nauto gpu_side_buffer = cuda::memory::make_unique_span\u003cfloat\u003e(device, n);\ncuda::memory::copy(gpu_side_buffer, host_side_buffer);\nauto launch_config = cuda::launch_config_builder().overall_size(n).block_size(256).build();\ncuda::launch(my_kernel, launch_config, gpu_side_buffer.data());\ncuda::memory::copy(host_side_buffer, gpu_side_buffer);\n```\nWell, now all of the above is valid code! :-)\n\nTo be a little more thorough than just an anecdote, let's relate back to some of the design principles listed above:\n\n#### Use of namespaces (and internal classes)\nWith this library, you would do `cuda::memory::host::allocate(num_bytes)` instead of calling `cudaMallocHost()` or `cuMemAllocHost()`; and if you want to allocate global device memory, it would be `my_device.memory.allocate(num_bytes)` (or `cuda::device::get(device_id).memory.allocate(num_bytes)`. Or it could be a stand-alone function as well, i.e. `cuda::memory::device::allocate(my_device, num_bytes)`. The compiled version of these calls will be nothing but the sequence of API calls: `cuInit()`, `cuDevicePrimaryCtxRetain()`, `cuCtxPushCurrent()`, `cuMemAlloc()` etc.\n\n#### Adorning POD structs with convenience methods\nThe expression\n```\nmy_device.compute_capability() \u003e= cuda::make_compute_capability(60)\n```\nis a valid comparison, true for all devices with a Pascal-or-later micro-architecture. This, despite the fact that `struct cuda::compute_capability_t` is a POD type with two unsigned integer fields, not a scalar.\n\n#### Meaningful naming\nInstead of using\n```cpp\ncudaError_t cudaEventCreateWithFlags(\n    cudaEvent_t* event,\n    unsigned int flags)\n```\nwhich requires you remember what you need to specify as flags and how, you create a `cuda::event_t` proxy object, using the function:\n```cpp\ncuda::event_t cuda::event::create(\n    cuda::device_t  device,\n    bool            uses_blocking_sync,\n    bool            records_timing      = cuda::event::do_record_timing,\n    bool            interprocess        = cuda::event::not_interprocess)\n```\nThe default values here are `enum : bool`'s, which you can use yourself when creating non-default-parameter events - to make the call more easily readable than with `true` or `false`.\n\n## Example programs\n\nIn lieu of a full-fledged user's guide, I'm providing several kinds of example programs; browsing their source you'll know most of what there is to know about the API wrappers. To build and run the examples (just as a sanity check), execute the following (in a Unix-style command shell):\n\n```bash\ncmake -S . -B build -DCAW_BUILD_EXAMPLES=ON .\ncmake --build build/\nfind build/examples/bin -type f -executable -exec \"{}\" \";\"\n```\n\nThe two main kinds of example programs are:\n\n#### Modified CUDA samples\n\nThe CUDA distribution contains sample programs demostrating various features and concepts. A few of these - which are not focused on device-side work - have been adapted to use the API wrappers - completely foregoing direct use of the CUDA Runtime API itself. You will find them in the [modified CUDA samples](https://github.com/eyalroz/cuda-api-wrappers/tree/master/examples/modified_cuda_samples/) example programs folder.\n\n#### 'Coverage' programs - by API module\n\nGradually, an example program is being added for each one of the CUDA Runtime API [Modules](http://docs.nvidia.com/cuda/cuda-runtime-api/modules.html#modules), in which the approach replacing use of those module API calls by use of the API wrappers is demonstrated. These per-module example programs can be found [here](https://github.com/eyalroz/cuda-api-wrappers/tree/master/examples/by_runtime_api_module/).\n\n## Want to help? Report a bug? Give feedback?\n\n* Noticed a bug, compatibility issue, missing functionality or other problem? Please [file the issue](https://github.com/eyalroz/cuda-api-wrappers/issues) here on GitHub.\n* Started using the library in a publicly-available project? Please email [@eyalroz](https://github.com/eyalroz).\n* Want to help test new, improved versions? Please email [@eyalroz](https://github.com/eyalroz).\n* Interested in collaborating on coding/research work related to the library? Have a look at [@eyalroz' website](https://github.com/eyalroz).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyalroz%2Fcuda-api-wrappers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyalroz%2Fcuda-api-wrappers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyalroz%2Fcuda-api-wrappers/lists"}