As I know about tvm, for single op, tvm can compile high level ir to cuda c 
source code, and then use the nvcc to compile the source into an executable. To 
extract the PTX code, you can retrieve the source code and use appropriate 
tools to compile it into PTX.

```python
cuda_mod = tvm.build(sch.mod, target="cuda")
c_source_code = cuda_mod.imported_modules[0].get_source()

# Save the CUDA C source code to a file  
with open("cuda_source_code.cu", "w") as output_file:  
    output_file.write(c_source_code)  
# nvcc -ptx -o output.ptx cuda_source_code.cu  
```

Btw, I think the simplest way to obtain the ptx code is to use Nvidia Nsight 
Compute to profile a TVM CUDA runtime. You can get the ptx code in the source 
window.

Regarding the network, I don't see any built-in pass that directly generates a 
PTX source file.





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/inquiry-about-obtaining-ptx-assembly-code-from-tvm/15510/2)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/dd1abab4f9e9b830a8c250e2d2022376ac48278d0a63dffc30143bdeedb9aaee).

Reply via email to