SYangDong commented on pull request #9436:
URL: https://github.com/apache/tvm/pull/9436#issuecomment-958668046
@comaniac Thank you for your explaination. IMHO, entry function is a
relative concept. Relative to host funciton,the device function is not entry
function,definitely. But when having __device__ function and __global__
fucntion, the global function is the entry function of the device function.
Maybe I misuse the tag entry_function. Take the code below for example:
```A = te.var('A')
B = te.var('B')
callee = tir.PrimFunc([A, B], tir.Evaluate(tir.Add(A, B)))
callee = callee.with_attr('global_symbol', 'callee')
main = tir.PrimFunc([A, B], tir.Evaluate(tir.Call('int32', callee, [A, B])))
# OR main = tir.PrimFunc([A, B], tir.Evaluate(tir.Call('int32',
GlobalVar('callee'), [A, B])))
main = main.with_attr("global_symbol", "main")
main = main.with_attr("tir.noalias", True)
mod = tvm.IRModule({"main": main, "callee": callee})
tvm.build(mod)
```
So if I add a tag of the main function, tvm can generate the "__global__
void" adn "__device__ void" correspondingly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]