-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C/C++ bindings #439
Comments
I would really like the ability to do this, esp. with rust support. |
Yeah I think we can start with a standard C interface and most other languages like C++/rust/go/Ruby can make use of it as well. |
Makes sense. I'd be happy to help out with this but I'm personally not sure where to start. |
For CPU code we can just dump LLVM IR and use taichi/taichi/backends/codegen_llvm_x86.cpp Line 104 in abbf5b1
We should explore this direction and a good starting point is to compile a simple taichi kernel, such as for i in range(n):
a[i] += 1 Some related discussions on SO: https://stackoverflow.com/questions/22956761/generate-binary-code-shared-library-from-embedded-llvm-in-c For GPU code we can simply dump the compiled PTX and invoke the CUDA runtime to load and run the PTX code. |
Possible solution: |
How to convert |
Warning: The issue has been out-of-update for 50 days, marking |
#1332 could be a systematic solution for this. |
Concisely describe the proposed feature
A few users want to ship compiled Taichi kernels, so that they can run it without Python
Describe the solution you'd like
We can add a method like
ti.export_all(lang='C'/'C++')
, to dumpThen users can basically do something like
... or using a more OOP C++ version.
Additional comments
If you also need this or have any suggestions, please feel free to comment! :-)
The text was updated successfully, but these errors were encountered: