Skip to content

Archived version of pkstene/pybind11-cuda under original MIT license

License

Notifications You must be signed in to change notification settings

Pyrestone/pybind11-cuda

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pybind11-cuda

Starting point for GPU accelerated python libraries

Adapted from original work from https://github.com/PWhiddy/pybind11-cuda

Present work uses modern CMake/Cuda approach

Prerequisites

Cuda

Python 3.6 or greater

Cmake >= 3.12 (for CUDA support and the new FindPython3 module)

To build

mkdir build; cd build
# provide a default cuda hardware architecture to build for
export CUDAFLAGS="-arch=sm_50"
cmake ..
make

Test it with python3 test_mul.py

gpu_library.so and test_mul.py must be in the same folder. Alternatively you can path to gpu_library.so to your PYTHONPATH env variable.

Features demonstrated

  • Compiles out of the box with cmake
  • Numpy integration
  • C++ Templating for composable kernels with generic data types

Originally based on https://github.com/torstem/demo-cuda-pybind11

About

Archived version of pkstene/pybind11-cuda under original MIT license

Resources

License

Stars

Watchers

Forks

Languages

  • CMake 86.7%
  • Cuda 11.0%
  • Python 2.3%