cuvec

Unifying Python/C++/CUDA memory: Python buffered array ↔️ `std::vector` ↔️ CUDA managed memory

https://github.com/amypad/cuvec

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.5%) to scientific vocabulary

Keywords

array buffer c cpp cpu cpython cpython-api cpython-extensions cuda cxx gpu hacktoberfest pybind11 python swig vector

Keywords from Contributors

parallel data-version-control developer-tools reproducibility unstructured-data animations
Last synced: 6 months ago · JSON representation ·

Repository

Unifying Python/C++/CUDA memory: Python buffered array ↔️ `std::vector` ↔️ CUDA managed memory

Basic Info
Statistics
  • Stars: 81
  • Watchers: 3
  • Forks: 3
  • Open Issues: 9
  • Releases: 37
Topics
array buffer c cpp cpu cpython cpython-api cpython-extensions cuda cxx gpu hacktoberfest pybind11 python swig vector
Created about 5 years ago · Last pushed 7 months ago
Metadata Files
Readme Contributing Citation

README.rst

CuVec
=====

Unifying Python/C++/CUDA memory: Python buffered array  C++11 ``std::vector``  CUDA managed memory.

|Version| |Downloads| |Py-Versions| |DOI| |Licence| |Tests| |Coverage|

.. contents:: Table of contents
   :backlinks: top
   :local:

Why
~~~

Data 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.

However, in practice converting between data formats across languages can be a pain.

Other 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.

- Less boilerplate code (fewer bugs, easier debugging, and faster prototyping)
- Fewer memory copies (faster execution)
- Lower memory usage (do more with less hardware)

Non objectives
--------------

Anything to do with mathematical functionality. The aim is to expose functionality, not (re)create it.

Even something as simple as setting element values is left to the user and/or pre-existing features - for example:

- Python: ``arr[:] = value``
- NumPy: ``arr.fill(value)``
- CuPy: ``cupy.asarray(arr).fill(value)``
- C++: ``std::fill(vec.begin(), vec.end(), value)``
- C & CUDA: ``memset(vec.data(), value, sizeof(T) * vec.size())``

Install
~~~~~~~

Requirements:

- Python 3.7 or greater (e.g. via `Anaconda or Miniconda `_, or via ``python3-dev``)
- (optional) `CUDA SDK/Toolkit `_ (including drivers for an NVIDIA GPU)

  * note that if the CUDA SDK/Toolkit is installed *after* CuVec, then CuVec must be re-installed to enable CUDA support

.. code:: sh

    pip install cuvec

Usage
~~~~~

See `the usage documentation `_ and `quick examples `_ of how to upgrade a Python  C++  CUDA interface.

See also `NumCu `_, a minimal stand-alone Python package built using CuVec.

External Projects
~~~~~~~~~~~~~~~~~

For integration into Python, C++, CUDA, CMake, pybind11, and general SWIG projects, see `the external project documentation `_.
Full and explicit example modules using the `CPython API `_, `pybind11 API `_, and `SWIG `_ are also provided.

Contributing
~~~~~~~~~~~~

See `CONTRIBUTING.md `_.

Licence
~~~~~~~

|Licence| |DOI|

Copyright:

- `Casper O. da Costa-Luis `_
- `Contributors `_

.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4446211.svg
   :target: https://doi.org/10.5281/zenodo.4446211
.. |Licence| image:: https://img.shields.io/pypi/l/cuvec.svg?label=licence
   :target: https://github.com/AMYPAD/CuVec/blob/main/LICENCE
.. |Tests| image:: https://img.shields.io/github/actions/workflow/status/AMYPAD/CuVec/test.yml?branch=main&logo=GitHub
   :target: https://github.com/AMYPAD/CuVec/actions
.. |Downloads| image:: https://img.shields.io/pypi/dm/cuvec?logo=pypi&logoColor=white
   :target: https://pypi.org/project/cuvec
.. |Coverage| image:: https://codecov.io/gh/AMYPAD/CuVec/branch/main/graph/badge.svg
   :target: https://codecov.io/gh/AMYPAD/CuVec
.. |Version| image:: https://img.shields.io/pypi/v/cuvec.svg?logo=python&logoColor=white
   :target: https://github.com/AMYPAD/CuVec/releases
.. |Py-Versions| image:: https://img.shields.io/pypi/pyversions/cuvec.svg?logo=python&logoColor=white
   :target: https://pypi.org/project/cuvec

Owner

  • Name: AMYPAD
  • Login: AMYPAD
  • Kind: organization
  • Location: Europe

Amyloid imaging to prevent Alzheimer's Disease

Citation (CITATION.cff)

cff-version: 1.2.0
message: If you use this software, please cite it using this metadata.
type: software
title: 'CuVec: Unifying Python/C++/CUDA memory'
abstract: Python buffered array -> C++11 `std::vector` -> CUDA managed memory
license: MPL-2.0
url: https://amypad.github.io/CuVec
authors:
- family-names: da Costa-Luis
  given-names: Casper O.
  orcid: https://orcid.org/0000-0002-7211-1557
  affiliation: "University College London, King's College London"
identifiers:
- type: doi
  value: 10.5281/zenodo.4446211
keywords: [Python, C, C++, buffer, vector, array, CUDA, CPython, SWIG, pybind11, extensions, API]

GitHub Events

Total
  • Create event: 5
  • Release event: 1
  • Issues event: 2
  • Watch event: 3
  • Delete event: 3
  • Issue comment event: 13
  • Push event: 26
  • Pull request event: 4
  • Fork event: 1
Last Year
  • Create event: 5
  • Release event: 1
  • Issues event: 2
  • Watch event: 3
  • Delete event: 3
  • Issue comment event: 13
  • Push event: 26
  • Pull request event: 4
  • Fork event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 297
  • Total Committers: 3
  • Avg Commits per committer: 99.0
  • Development Distribution Score (DDS): 0.01
Past Year
  • Commits: 12
  • Committers: 2
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.167
Top Committers
Name Email Commits
Casper da Costa-Luis c****l@p****g 294
pre-commit-ci[bot] 6****] 2
Helio Machado 0****t@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 12
  • Total pull requests: 41
  • Average time to close issues: 4 days
  • Average time to close pull requests: 22 days
  • Total issue authors: 3
  • Total pull request authors: 3
  • Average comments per issue: 0.17
  • Average comments per pull request: 1.39
  • Merged pull requests: 34
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 2
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • casperdcl (10)
  • OliJimbo (1)
  • jhuguetn (1)
Pull Request Authors
  • casperdcl (40)
  • pre-commit-ci[bot] (6)
  • 0x2b3bfa0 (1)
Top Labels
Issue Labels
enhancement (8) documentation (2)
Pull Request Labels
framework (23) enhancement (18) documentation (14) bug (13)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 421 last-month
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 40
  • Total maintainers: 1
pypi.org: cuvec

Unifying Python/C++/CUDA memory: Python buffered array -> C++11 `std::vector` -> CUDA managed memory

  • Versions: 39
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 307 Last month
Rankings
Dependent packages count: 4.8%
Stargazers count: 7.9%
Downloads: 13.2%
Average: 13.3%
Forks count: 19.1%
Dependent repos count: 21.5%
Maintainers (1)
Last synced: 7 months ago
pypi.org: cuvec-base

No-except installation of `cuvec`

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 114 Last month
Rankings
Stargazers count: 7.9%
Dependent packages count: 10.1%
Average: 16.0%
Forks count: 19.1%
Downloads: 21.5%
Dependent repos count: 21.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • jsmin python3-only
  • mkdocs-material <8.1.3
  • mkdocs-minify-plugin *
  • pydoc-markdown >=4
  • pygments *
  • pymdown-extensions >=9
.github/workflows/comment-bot.yml actions
  • actions/checkout v3 composite
  • actions/github-script v6 composite
.github/workflows/test.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • casperdcl/deploy-pypi v2 composite
  • casperdcl/push-dir v1 composite
  • codecov/codecov-action v3 composite
  • reviewdog/action-setup v1 composite
pyproject.toml pypi
  • importlib_resources python_version < "3.9"
  • numpy *