How to call void extern function?


#1

I want to use device api function like “memcpy(src, sdt, length)” with “tvm.call_extern”. But this function expression won’t appear in codegen, because it return void, and be ignored after lower.
So, is there any solution to add this device api?
Thanks for your reply !


#2

You should be able to do that with ir_builder, to emit a statement, and declare memcpy’s return value as int


#3

Thanks, I never pay a attention to the “emit” api, but it really works! This question confuse me all day… Thanks again!