How to see the original cuda code generated by tvm

    lib = relay.build_module.build(module, target, params=None)
    print(lib.lib.get_source())

Hi all, I’m using the above code to see the code generated by tvm. when I set target = ‘c’, I get the C code.

When I set it to ‘cuda’, the source code seems to be PTX. How can I get the cuda code?

lib.imported_modules[0].get_source()

I’m sorry but it doesn’t work.

(Pdb) dir(lib)
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__next__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'executor', 'export_library', 'function_metadata', 'get_devices', 'get_executor_config', 'get_graph_json', 'get_lib', 'get_params', 'graph_json', 'ir_mod', 'iter_cnt', 'lib', 'libmod_name', 'module', 'params', 'target']

there is no attribute as imported_modules

lib.lib.imported_modules[0].get_source()

this works, thank you!