Hi,
I would like to generate C code in my python script like this:
cc_code = """
extern "C" int my_conv2d(float* data, float* weight, float* output) {
// code in C of my convolution
}
"""
and then be able to use it with te.extern (or something else) to call this function:
Output = tvm.te.extern(
output_size,
[A, W],
lambda ins, outs: tvm.tir.call_packed(
"my_conv2d", ins[0], ins[1], outs[0], other_arguments
),
name="Output",
)
I have seen how pragma is used in this file tests/python/all-platform-minimal-test/test_minimal_target_codegen_llvm.py
Unfortunately, I can’t use pragma here because I make a te.extern call and I don’t want to make a value by value function call as it is done in the test_minimal_target_codegen_llvm.py file. I just want to run my_conv2d to do my convolution and get the output.
Is it possible to make a C function, generate an LLVM IR and use this function with te.extern or something else?
Thank you