Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.05 KB

02-ptx.md

File metadata and controls

37 lines (26 loc) · 1.05 KB

Example: PTX

This example covers the following features on top of what was shown in the basic example:

  • defining __device__ functions
    • ptx_add()
    • ptx_lop3()
  • using C++ templates with __device__ and __global__ functions
    • ptx_lop3()
    • kernelLop3()
  • using inline PTX Assembly asm(...); blocks
    • ptx_add()
    • ptx_lop3()

Build and run the example by following the general instructions.

Extra info

PTX instructions used:

Example source code

---8<--- "public/examples/src/ptx/ptx.cu"

CMakeLists.txt used

---8<--- "public/examples/src/ptx/CMakeLists.txt"