I am adding support for a CUSTOM hardware in tvm using Codegen method for TVM 
BYOC  
Currently hardware requires a call to  INIT and DEINIT methods. We need to add 
the  calls in the generated C code using codegen instead of embedding this 
logic in custom runtime.   
AS we can have n modules, one for each subgraph getting offloaded to custom 
hardware , current implementation insert these init and deinit calls in C code 
of each and every module, which turns out to be very inefficient.  
Hence i needed some help in figuring out if there is a way to declare a bool 
operator (init_done) which somehow tells the custom codegen to only insert the 
init call in C code if init_done is false, else ignore the  insertion all 
together.  
the C modules look something like this:  
```
module 1{
  CUSTOM_init()
  some calls
  CUSTOM_deinit()
}
..
..
..
module n{
  CUSTOM_init()
  some calls
  CUSTOM_deinit()
}
```
whereas i want it to be something like this:
```
module 1{
  CUSTOM_init()
  some calls
}
..
..
..
module n{
  some calls
  CUSTOM_deinit()
}
```





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/pim-byoc-how-to-make-generated-c-modules-aware-of-a-global-member-in-custom-codegen/15493/1)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/fee22bb791b36361d4372cd0920fe16759d06dabc1603a5c832505d0b3b4e1ea).

Reply via email to