Supported declarations#
ast_canopy recognizes and serializes a subset of CUDA C++ declarations for downstream consumers.
Concrete structs and classes#
Constructors generate typing and lowering for instantiation
Conversion operators are mapped to Python conversions
Public fields are exposed for read access
Functions and operators#
Free functions receive typing and lowering for all overloads
Operator overloads are mapped to Python operators (e.g.,
operator+→operator.add)
Templates#
Class templates (e.g.,
template<class T> struct Vec) are serialized with template parameters and their declaration bodies for downstream specialization/instantiation.Function templates (e.g.,
template<typename T> T add(T, T)) are serialized with parameter lists and signatures so consumers can materialize concrete overloads.Where present, explicit specializations and explicit instantiations are captured as distinct declarations.
Example mapping#
Kind |
C++ Declaration |
C++ Usage |
Numba Usage |
Notes |
|---|---|---|---|---|
Concrete Struct Constructor |
|
|
|
Generates type, data model, typing, lowering |
Conversion Operator |
|
|
|
Conversion operator mapping |
Public Attribute |
|
|
|
Read-only access |
Function |
|
|
|
Typing/lowering for overloads |
Operator overload |
|
|
|
Mapped to appropriate Python operator |
Class template |
|
|
N/A (serialization only) |
Template parameters and body captured for downstream specialization |
Function template |
|
|
N/A (serialization only) |
Template parameters/signature captured; specializations/instantiations recorded when present |