What are the adj_xxx functions in mesh.h for?
yuhan-zh opened this issue · comments
Hello!
I am trying to add a function named "adj_mesh_query_edge", it works similarly as "adj_mesh_query_ray".
When I am trying to run the program, this error shows:
Warp NVRTC compilation error 6: NVRTC_ERROR_COMPILATION (.\workspace\warp\warp\native\warp.cu:1107)
......
default_program(21381): error: namespace "wp" has no member "adj_mesh_query_edge"
wp::adj_mesh_query_edge(var_40, var_7, var_9, var_37, var_42, var_43, var_44, var_45, var_41, adj_40, adj_7, adj_9, adj_37, adj_42, adj_43, adj_44, adj_45, adj_41, adj_46);
......
Therefore,
- I am wondering why the system asks for a function named as "adj_mesh_query_edge" after I defined a function named "mesh_query_edge".
- And I also noticed that there are other adj_xxx functions defined for other corresponding xxx functions. But I didn't find from where these adj_xxx functions can be called. So I am wondering when will these function be called and what these adj_xxx functions are expected to do?
Thank you!
Hi @yuhan-zh , the adj_*
functions are for computing gradients when doing back propagation.
For native methods you need to implemente these yourself if you want gradients. Otherwise, if you don't need gradients then you can just write an empty "stub" function with the right signature. I recommend taking a look at adj_mesh_query_point()
for an example of the signature, basically each input is repeated as an adj_
variable, plus the return type.
I got it now, thanks for your reply!