Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CUDA: Understanding the PTX info

Tags:

cuda

I'm not finding much useful info on PTX info --ptxas-options=-v I found a 2008 NVCC pdf that has a small blurb, but no details.
1) What is 64 bytes cmem[0], 12 bytes cmem[16] mean? I gather it refers to constant memory. I don't use any constant mem in the code, so this must come from the compiler. (What goes into RO mem?)
2) What does 49152+0 bytes smem mean? Yes, it is shared memory, but what do the two #'s mean?
3) Is there a doc that will help me with this? (What is it called?)
4) Where can I find a doc that will explain the *.ptx file? (I'd like to be able to read/understand the cuda assy code.)

like image 429
Doug Avatar asked Sep 07 '12 17:09

Doug


2 Answers

  1. cmem is dicussed here. In your case it means 64 bytes are used to pass arguments to kernel and 12 bytes are occupied by compiler-generated constants.

  2. In case of smem, the first number is the amount of data your code request, and the second number (0) indicates how much memory is used for system purposes.

  3. I don't know of any official information regarding verbose ptxas output format. E.g. in "CUDA Occupancy calculator" they simply say to sum the values for smem without any explnations.

  4. There are several PTX docs on nVidia website. The most fundamental is PTX: Parallel Thread Execution ISA Version 3.0.

like image 136
aland Avatar answered Nov 16 '22 06:11

aland


Please see "Miscellaneous NVCC Usage". They mention, that the constant bank allocation is profile-specific.

In the PTX guide, they say that apart from 64KB constant memory, they had 10 more banks for constant memory. The driver may allocate and initialize constant buffers in these regions and pass pointers to the buffers as kernel function parameters.

I guess, that profile given for nvcc will take care of which constants go into which memory. Anyway, we don't need to worry if each constant memory cmem[n] is less than 64KB, because each bank is of size 64KB and common to all threads in grid.

like image 37
lxkarthi Avatar answered Nov 16 '22 05:11

lxkarthi