Skip to content

Add C backend to Compyle#125

Open
aerorohit wants to merge 1 commit intopypr:mainfrom
aerorohit:add_c_baackend_main
Open

Add C backend to Compyle#125
aerorohit wants to merge 1 commit intopypr:mainfrom
aerorohit:add_c_baackend_main

Conversation

@aerorohit
Copy link
Contributor

Add C backend to Compyle

Summary

  • Adds a new c backend that transpiles annotated Python functions to C and compiles them via pybind11, enabling direct C
    execution without the Cython overhead.
  • Introduces CBackend (in c_backend.py) — a CythonGenerator subclass that generates pybind11 binding code alongside the C
    source, and CCompile for single-function compilation.
  • Extends Elementwise, Reduction, and Scan in parallel.py to support backend='c', generating templated C kernels with
    pybind11 bindings.

Unit tests

  • tests/test_c_backend.py — new unit tests for CBackend/CCompile
  • tests/test_cimport.py — new unit tests for Cmodule
  • tests/test_parallel.py — extended parallel primitive tests covering the c backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant