{"id":15047978,"url":"https://github.com/amypad/cuvec","last_synced_at":"2025-04-05T06:02:34.161Z","repository":{"id":43701780,"uuid":"330259597","full_name":"AMYPAD/CuVec","owner":"AMYPAD","description":"Unifying Python/C++/CUDA memory: Python buffered array ↔️ `std::vector` ↔️ CUDA managed memory","archived":false,"fork":false,"pushed_at":"2025-03-03T16:26:31.000Z","size":751,"stargazers_count":80,"open_issues_count":8,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T05:09:55.862Z","etag":null,"topics":["array","buffer","c","cpp","cpu","cpython","cpython-api","cpython-extensions","cuda","cxx","gpu","hacktoberfest","pybind11","python","swig","vector"],"latest_commit_sha":null,"homepage":"https://amypad.github.io/CuVec/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AMYPAD.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-16T21:16:49.000Z","updated_at":"2025-03-09T16:57:18.000Z","dependencies_parsed_at":"2024-03-12T20:29:29.002Z","dependency_job_id":"dfc6b200-ca4b-4721-a014-6b9c84797239","html_url":"https://github.com/AMYPAD/CuVec","commit_stats":{"total_commits":287,"total_committers":4,"mean_commits":71.75,"dds":0.03135888501742157,"last_synced_commit":"01a42d47eb97dea3a9608a03e5d97dcb91a338c1"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AMYPAD%2FCuVec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AMYPAD%2FCuVec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AMYPAD%2FCuVec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AMYPAD%2FCuVec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AMYPAD","download_url":"https://codeload.github.com/AMYPAD/CuVec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246140588,"owners_count":20729802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["array","buffer","c","cpp","cpu","cpython","cpython-api","cpython-extensions","cuda","cxx","gpu","hacktoberfest","pybind11","python","swig","vector"],"created_at":"2024-09-24T21:06:26.688Z","updated_at":"2025-03-29T05:10:02.094Z","avatar_url":"https://github.com/AMYPAD.png","language":"Python","readme":"CuVec\n=====\n\nUnifying Python/C++/CUDA memory: Python buffered array ↔ C++11 ``std::vector`` ↔ CUDA managed memory.\n\n|Version| |Downloads| |Py-Versions| |DOI| |Licence| |Tests| |Coverage|\n\n.. contents:: Table of contents\n   :backlinks: top\n   :local:\n\nWhy\n~~~\n\nData should be manipulated using the existing functionality and design paradigms of each programming language. Python code should be Pythonic. CUDA code should be... CUDActic? C code should be... er, Clean.\n\nHowever, in practice converting between data formats across languages can be a pain.\n\nOther libraries which expose functionality to convert/pass data formats between these different language spaces tend to be bloated, unnecessarily complex, and relatively unmaintainable. By comparison, ``cuvec`` uses the latest functionality of Python, C/C++11, and CUDA to keep its code (and yours) as succinct as possible. \"Native\" containers are exposed so your code follows the conventions of your language. Want something which works like a ``numpy.ndarray``? Not a problem. Want to convert it to a ``std::vector``? Or perhaps a raw ``float *`` to use in a CUDA kernel? Trivial.\n\n- Less boilerplate code (fewer bugs, easier debugging, and faster prototyping)\n- Fewer memory copies (faster execution)\n- Lower memory usage (do more with less hardware)\n\nNon objectives\n--------------\n\nAnything to do with mathematical functionality. The aim is to expose functionality, not (re)create it.\n\nEven something as simple as setting element values is left to the user and/or pre-existing features - for example:\n\n- Python: ``arr[:] = value``\n- NumPy: ``arr.fill(value)``\n- CuPy: ``cupy.asarray(arr).fill(value)``\n- C++: ``std::fill(vec.begin(), vec.end(), value)``\n- C \u0026 CUDA: ``memset(vec.data(), value, sizeof(T) * vec.size())``\n\nInstall\n~~~~~~~\n\nRequirements:\n\n- Python 3.7 or greater (e.g. via `Anaconda or Miniconda \u003chttps://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html#anaconda-or-miniconda\u003e`_, or via ``python3-dev``)\n- (optional) `CUDA SDK/Toolkit \u003chttps://developer.nvidia.com/cuda-downloads\u003e`_ (including drivers for an NVIDIA GPU)\n\n  * note that if the CUDA SDK/Toolkit is installed *after* CuVec, then CuVec must be re-installed to enable CUDA support\n\n.. code:: sh\n\n    pip install cuvec\n\nUsage\n~~~~~\n\nSee `the usage documentation \u003chttps://amypad.github.io/CuVec/#usage\u003e`_ and `quick examples \u003chttps://amypad.github.io/CuVec/#examples\u003e`_ of how to upgrade a Python ↔ C++ ↔ CUDA interface.\n\nSee also `NumCu \u003chttps://github.com/AMYPAD/NumCu\u003e`_, a minimal stand-alone Python package built using CuVec.\n\nExternal Projects\n~~~~~~~~~~~~~~~~~\n\nFor integration into Python, C++, CUDA, CMake, pybind11, and general SWIG projects, see `the external project documentation \u003chttps://amypad.github.io/CuVec/#external-projects\u003e`_.\nFull and explicit example modules using the `CPython API \u003chttps://github.com/AMYPAD/CuVec/tree/main/cuvec/src/example_cpython\u003e`_, `pybind11 API \u003chttps://github.com/AMYPAD/CuVec/tree/main/cuvec/src/example_pybind11\u003e`_, and `SWIG \u003chttps://github.com/AMYPAD/CuVec/tree/main/cuvec/src/example_swig\u003e`_ are also provided.\n\nContributing\n~~~~~~~~~~~~\n\nSee `CONTRIBUTING.md \u003chttps://github.com/AMYPAD/CuVec/blob/main/CONTRIBUTING.md\u003e`_.\n\nLicence\n~~~~~~~\n\n|Licence| |DOI|\n\nCopyright:\n\n- `Casper O. da Costa-Luis \u003chttps://github.com/casperdcl\u003e`_\n- `Contributors \u003chttps://github.com/AMYPAD/cuvec/graphs/contributors\u003e`_\n\n.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4446211.svg\n   :target: https://doi.org/10.5281/zenodo.4446211\n.. |Licence| image:: https://img.shields.io/pypi/l/cuvec.svg?label=licence\n   :target: https://github.com/AMYPAD/CuVec/blob/main/LICENCE\n.. |Tests| image:: https://img.shields.io/github/actions/workflow/status/AMYPAD/CuVec/test.yml?branch=main\u0026logo=GitHub\n   :target: https://github.com/AMYPAD/CuVec/actions\n.. |Downloads| image:: https://img.shields.io/pypi/dm/cuvec?logo=pypi\u0026logoColor=white\n   :target: https://pypi.org/project/cuvec\n.. |Coverage| image:: https://codecov.io/gh/AMYPAD/CuVec/branch/main/graph/badge.svg\n   :target: https://codecov.io/gh/AMYPAD/CuVec\n.. |Version| image:: https://img.shields.io/pypi/v/cuvec.svg?logo=python\u0026logoColor=white\n   :target: https://github.com/AMYPAD/CuVec/releases\n.. |Py-Versions| image:: https://img.shields.io/pypi/pyversions/cuvec.svg?logo=python\u0026logoColor=white\n   :target: https://pypi.org/project/cuvec\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famypad%2Fcuvec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famypad%2Fcuvec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famypad%2Fcuvec/lists"}