Skip to content

Proof-of-concept of calling a Numba jit'd function from Rust from Python using CFFI

Notifications You must be signed in to change notification settings

synapticarbors/rust-numba-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-numba-test

Proof-of-concept of calling a Numba jit'd function from Rust from Python using CFFI

This example defines a function in Rust that doubles the result of the function passed to it. The Numba @cfunc decorator with CFFI support requires Numba 0.27. This allows Numba to create a C callback that can be passed to Rust.

Basic instructions for running the example:

If you need to install numba, then I recommend first getting Miniconda and then:

conda create -n rust-numba-example cffi numba numpy
source activate rust-numba-example  # or just `activate rust-numba-example` on Windows

Then to compile the Rust code and run the python example:

cargo build --release
python test.py

About

Proof-of-concept of calling a Numba jit'd function from Rust from Python using CFFI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages