C code generator


Dear contributors,

I’d like to generate C code from tvm and found a related issue:

Follow me, the tvm::codegen::CodeGenC function may provide the C source code from TVM program but it is not currently enabled .

My question is that there are any ways to enable this feature or another method to generate C code from TVM program?



no, it is not possible. tvm::codegen::CodeGenC is only meant to be used internally by other C-like code generators such as cuda and opencl.


Thanks you for your response,

Is there another way to generate C code from TVM program or work-around, follow you?


no, as far as I know.


related Will TVM suppurt GCC as an optional CPU compiler?


Any update on this topic?
This might actually be an interesting use case if one wants to use TVM as a source-to-source compiler.


yes, we now have it.


Is there example to generate C code from host?