Is there any options in clang/hipcc that allow to filter only IR from device kernels when using the `-emit-llvm -S` option?

Suppose I have a .cc file containing both device kernel vec_add and host function main, how can I get the IR only from the device kernel when generating the IR?

--offload-device-only seems to be what you’re looking for: Clang command line argument reference — Clang 17.0.0git documentation (

It works! Thanks very much.