reduce the no of register per thread used

hi,

i am getting following error which running one of my kernel

TOO MANY RESOURCES REQUESTED FOR LAUNCH

is this error solely due to maximum number of registers per thread used?

upon getting this error what should we do?

here is my ptxas output:-

ptxas info : Compiling entry function ‘_Z10readvaluePsii’
ptxas info : Used 16 registers, 32+28 bytes smem, 2 bytes cmem[0], 4 bytes cmem[1]
ptxas info : Compiling entry function ‘_Z15interpolateP6float3’
ptxas info : Used 21 registers, 24+16 bytes smem, 2 bytes cmem[0], 4 bytes cmem[1]

grid(9,1,1)
block(7,63,1)

so for second kernel i get 7 63 21 > 8192

Is this my problem? if yes, how can i fix this?

if no, what can be the other factor responsible for this error?

thank you
miztaken

An efficient way to decrease number of register used is to declare volatile variables whenever you reuse them inside your kernel. Moreover don’t use double values if you really don’t need them (keep attention: don’t use, for example, i = 0 but i= 0f. Don’t forget f!).
Use shared memory instead of register, it seems that you’re not using it!
Cheers,

luca

Your grid is too small for my taste (an 8800GT and 260GTX card would use all their MPs for example)

If your algorithm or problem allows it, remove about half of the threads from each block and create twice the amount of blocks to compensate for that.

Christian