Count instructions of compilation

Hi there

I’m fairly new to this subject so please be kind if I have misunderstood something.

I’m comparing two stategies of implementation. The first implementation is fetching data as plain integers while the other fetches data from a datastructure, which I have implemented myself.

I want to predict the overhead of my data structure in terms of instructions. The functions handeling the datastructure is called 6 bio. times but when I profile my code the profiler tells me that the difference between the two implementations is only 30k instructions - I would have expected this number to somewhat higher.

To investigate this I want to examine the instructions generated from the functions handeling the data structure i.e. the ptx-code.

I have tried all sorts of compiler flags but can’t seem to get the ptx-code from my implementation. I do get ptx-files but they are rather empty.

I’m running VS2010 on windows 7.

  • Frederik

The Nsight VSE 3.0 CUDA Profiler has the ability to capture per instruction statistics and display the information at the assembly, PTX, and source level.

  1. In the Nsight menu execute Start Performance Analysis…
  2. Set the Activity Type to Profile CUDA Application
  3. Set the Experiment List to All or Custom
    a. If Custom add the experiment Instruction Count
  4. Launch the application
  5. Wait for the application to complete or kill the application after the kernel has executed
  6. When the nvreport opens you can navigate to the source view

The Source View can show annotated SASS, PTX, and high level source. In order to information at PTX and source level you need to compile with the flag --lineinfo.

It is possible to select all lines in the source views and paste the lines into a file. You can then diff the two files.