print("p2g") inside a
TypeError: make_const_expr_f32(): incompatible function arguments. The following argument types are supported:
1. (arg0: float) -> taichi_core.Expr
Invoked with: 'p2g'.
Is there a way of doing it?
For now, taichi doesn’t support printing strings inside a kernel. Only numbers are allowed due to hardware limitations. (sadly)
Btw, you can print debug info by setting environment variables:
TI_LOG_LEVEL=debug python your_file_name.py
thank you @archibate!
I found the print command reading the docs one more time and also realised that it only works with numbers. So, for printing a vector I do several separate prints: print(x); print(x); etc., and for matrices print(m[0,0]), etc.
I managed to debug my code and even running on the CPU it’s impressively fast!
Btw, we are trying to implement
print for matrix/vector/string now, see https://github.com/taichi-dev/taichi/issues/923!
cool! i’ll check it out. Thank you : )
News: printing a matrix or string is now supported in v0.6.6!
Thank you so much!! (I’m a very optimistic person: I took my first online course of Mandarin to try to understand your Taichi-con videos ! If we meet one day, I should be able to introduce myself )
Sounds cool! Feel free to ask help from native speakers when you need. I’m looking forward to meet you too Btw, it’s heard that @yuanming would like to held the TaichiCon 1 in English, would you like to participate? I will be there as an audience of course
I would love to participate! I’ve been using a script based on @yuanming’s 88-lines code for MPM, first transformed to 3D, and now using Taichi, for simulating brain growth and folding. I’d love to have your input!
import taichi as ti
ti.init(arch = ti.cpu)
x = 233