Sullivan Risk
Sullivan Risk

Reputation: 319

PTX code performance

I know CUDA (not bad), but I do not know PTX, so my questions are:

Upvotes: 0

Views: 1068

Answers (1)

user3813674
user3813674

Reputation: 2683

From my personal experiences, PTX helps in debugging/inspecting a non-trivial problem. I have done this only once, however. Also, remember that PTX is only the immediate code generated by the compiler, not the actual assembly language being executed on the GPU.

If you really want to look at machine code, which is assembled after PTX, NVIDA provides cuobjdump. I think PTX has a lot of useful information and good documentation, so learning it would help. However, the general optimization strategies for CUDA include:

  • Minimize memory transactions, particularly data transfer between device/host
  • Coalesce global memory access
  • Increase device utilization via kernel configuration
  • Avoid warp divergence

For your second question, yes you can write PTX in CUDA via inline PTX. I have never done this though.

Upvotes: 4

Related Questions