No double in program, but nvcc warns about it

Consider the following program:

#define DIMENSION 96

#define ITERATIONS 1e4

__constant__ float cmatrix[DIMENSION*DIMENSION];

__global__ void kernel_constant() {

	__shared__ float vin[DIMENSION];

	int tid = threadIdx.x;

	int iter, i, row;

	float temp;


	row = tid * DIMENSION;

	for(iter=0; iter < ITERATIONS; iter++) {

 	temp = 0;

 	for (i=0; i < DIMENSION; i++) {

 	temp += vin[i] * cmatrix[row + i];





int main( void ) {

	kernel_constant<<<1, DIMENSION, 0, 0>>>();


when compiling it, nvcc complains:

$ nvcc -o constant

ptxas /tmp/tmpxft_00000425_00000000-2_constant.ptx, line 61; warning : Double is not supported. Demoting to float

But there is no double anywhere to be seen. What am I doing wrong?

Must be something to do with the inbuilt functions you are using… Try sinf() instead of just sin()… Could be something on those lines…

Or any floating variable that you initialize must be explicitly initialized as float (ie float my_float=1.0f; instead as float my_float=1.0;)

Hmm. I’m not using any such functions.

Changing “temp = 0” to “temp = 0.0f” did not get rid of the warning either.

How about ITERATIONS? Why not write that out properly as an integer.

All the zeros looked just too ugly ;-). Thanks, that was the problem.