Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rtohid
- matrixb0tx
- any thoughts onthis
- from what I understand, you'll still need to provide the implementation for each instance of the opaque type anyway, so not a solution to the original problem, but more of a cleaner implementation approach
- matrixb0tx
- I would have to write custom binding for for every .hpp containing templates (all of them) and not templates can be . I am thinking a way to automate it this was the easiest way to do it by making is opaque . and cppyy . there so many differnt things you can do deciding which is right out is hard
- for clarity, maintainability, and keeping control, I don't think using cppyy is the way to go. I'd say starting with partial support for commonly used types would be the way to start. Once you've got driving examples rolling it would be easier to find a solution to extend the work
- hkaiser
- rtohid
- : he is not here today and logging is off
- satacker
- In reply to
- matrixb0tx
- rtohid
- for clarity, maintainability, and keeping control, I don't think using cppyy is the way to go. I'd say starting with partial support for commonly used types would be the way to start. Once you've got driving examples rolling it would be easier to find a solution to extend the work
- also cppyy does not support cpython 3+
- nooo, it does
- rtohid
- hkaiser
- rtohid
- : he is not here today and logging is off
- thanks! Meanwhile, can you share your insights on this? I'm generally interested to see if there's an elegant solution to bind template functions like this:
- https://github.com/pybind/pybind11/issues/199
- Template functions · Issue #199 · pybind/pybind11 - GitHub
- Is it possible to define template functions like #include <pybind11/pybind11.h> #include <pybind11/numpy.h> namespace py = pybind11; template <typename T> T square(T x) { return x * x; } void pyexp...
- hkaiser
- rtohid
- : you can't really bind template functions for arbitrary types - temolate functions are not functions after all
- rtohid
- hkaiser
- rtohid
- : you can't really bind template functions for arbitrary types - temolate functions are not functions after all
- So I guess JIT compilation is the only solution after all-- I suggested this to
- matrixb0tx
- but wasn't sure
- satacker
- How will JIT be used to infer types?
- hkaiser
- if you want to bind a template function for arbitrary type - yes, that sounds right
- the question is do we need to bind them for arbitrary types to begin with?
- for instance for binding async - the function to be called will most likely be a pythong function, so async could simply pass through all arguments as PyObjects
- rtohid
- satacker
- How will JIT be used to infer types?
- We have used python AST to inspect code before:
- https://github.com/STEllAR-GROUP/phylanx/tree/master/python/phylanx
- phylanx/python/phylanx at master · STEllAR-GROUP/phylanx - GitHub
- An Asynchronous Distributed C++ Array Processing Toolkit - phylanx/python/phylanx at master · STEllAR-GROUP/phylanx
- requiring type hints can make things even easier
- hkaiser
- yah, but that's not using JIT, at least not in the common way this term is used
- satacker
- In reply to
- satacker
- rtohid
- We have used python AST to inspect code before:
- https://github.com/STEllAR-GROUP/phylanx/tree/master/python/phylanx
- ohh, i just took JIT to be something much later in the pipeline, i.e. after knowing types
- rtohid
- hkaiser
- the question is do we need to bind them for arbitrary types to begin with?
- It was my understanding that most facilities are template functions but I guess it is the opposite and only a few are
- hkaiser
- yah, but that's not using JIT, at least not in the common way this term is used
- I just meant for type inference, not code generation
- hkaiser
- pybind allows to pass through variables back to python - that's what we most likely want to do
- rtohid
- In reply to
- rtohid
- satacker
- ohh, i just took JIT to be something much later in the pipeline, i.e. after knowing types
- you're right, types must be known
- satacker
- In reply to
- satacker
- rtohid
- We have used python AST to inspect code before:
- https://github.com/STEllAR-GROUP/phylanx/tree/master/python/phylanx
- Does it do something similar to https://benhoyt.com/writings/pyast64/
- i.e. visit each node type and if known types are found then do stuff
- Compiling Python syntax to x86-64 assembly for fun and (zero) profit
- A toy (but working) compiler that turns Python syntax into x86-64 assembly using Python's built-in AST module.
- rtohid
- Yes. We just transpiled to our own IR (PhySL)
- satacker
- Nice!
- hkaiser
- ahh matrixb0tx, we were just talking about your project
- matrixb0tx
- I cant see chat logs the site is down for some rean
- reason*
- hkaiser
- rtohid
- : ^^
- matrixb0tx
- can anything thing done about the logs I wanted to see some suggestion for my project
- hkaiser
- matrixb0tx: logs are down today because of some maintenance going on
Advertisement
Add Comment
Please, Sign In to add comment