All Projects → AMYPAD → CuVec

AMYPAD / CuVec

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

Programming Languages

python
139335 projects - #7 most used programming language
Cuda
1817 projects
CMake
9771 projects
SWIG
194 projects

Projects that are alternatives of or similar to CuVec

ara
The PULP Ara is a 64-bit Vector Unit, compatible with the RISC-V Vector Extension Version 0.10, working as a coprocessor to CORE-V's CVA6 core
Stars: ✭ 116 (+58.9%)
Mutual labels:  cpu, vector
rrbit-js
No description or website provided.
Stars: ✭ 11 (-84.93%)
Mutual labels:  vector, array
BitLens
🔎 Have your bits and eat them too! A C++17 bit lens container for vector types.
Stars: ✭ 20 (-72.6%)
Mutual labels:  vector, array
Graphical Debugging
GraphicalDebugging extension for Visual Studio
Stars: ✭ 88 (+20.55%)
Mutual labels:  vector, array
C Vector
A dynamic array implementation in C similar to the one found in standard C++
Stars: ✭ 234 (+220.55%)
Mutual labels:  vector, array
Containers
This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.
Stars: ✭ 125 (+71.23%)
Mutual labels:  vector, array
Blitz
Blitz++ Multi-Dimensional Array Library for C++
Stars: ✭ 257 (+252.05%)
Mutual labels:  vector, array
Staticvec
Implements a fixed-capacity stack-allocated Vec alternative backed by an array, using const generics.
Stars: ✭ 236 (+223.29%)
Mutual labels:  vector, array
deque
A highly optimized double-ended queue
Stars: ✭ 75 (+2.74%)
Mutual labels:  vector, array
go course
個人多年來學習與實作上的心得筆記
Stars: ✭ 25 (-65.75%)
Mutual labels:  swig
yadoms
Yadoms is open source, simple, powerfull, flexible and multiplatforms domotic solution.
Stars: ✭ 56 (-23.29%)
Mutual labels:  swig
smag
Show Me A Graph - Command Line Graphing
Stars: ✭ 78 (+6.85%)
Mutual labels:  cpu
8800-simulator
A JavaScript simulator to demonstrate the front panel operations of Altair 8800.
Stars: ✭ 65 (-10.96%)
Mutual labels:  cpu
avatarmake
Easily make your own cartoon avatar base on d3.js
Stars: ✭ 34 (-53.42%)
Mutual labels:  vector
vector
A javascript library for creating interactive graphics.
Stars: ✭ 154 (+110.96%)
Mutual labels:  vector
sirdez
Glorious Binary Serialization and Deserialization for TypeScript.
Stars: ✭ 20 (-72.6%)
Mutual labels:  buffer
matlib
Matrix Functions for Teaching and Learning Linear Algebra and Multivariate Statistics, http://friendly.github.io/matlib/
Stars: ✭ 55 (-24.66%)
Mutual labels:  vector
SuperformulaSVG
2D superformula line-art generator built in Processing, with SVG export for use in digital fabrication workflows.
Stars: ✭ 40 (-45.21%)
Mutual labels:  vector
vector
A PHP functional programming library.
Stars: ✭ 19 (-73.97%)
Mutual labels:  vector
vectorshapes-unity
Library for drawing vector shapes in Unity.
Stars: ✭ 44 (-39.73%)
Mutual labels:  vector

CuVec

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

Version Downloads Py-Versions DOI Licence Tests Coverage

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 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.6 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
pip install cuvec

Usage

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

External Projects

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

Contributing

See CONTRIBUTING.md.

Licence

Licence DOI

Copyright 2021

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].