cuSPARSE matrix vector multiplication non deterministic output

Hello,

I wrote a function that takes as input a bsr matrix and a vector in the host memory and allocates device memory calls cusparseDbsrmv() ,frees device memory and exits… and i noticed that if i run more than 1 times this function i get different output for the same input…can anyone help me?

void sparseMV(int* iA,int* jA,double* A,int Abd,int nzb,int bd,double* x, double* b){
/* b = Ax; */

int* dev_iA;
int* dev_jA;
double* dev_A;
double* dev_b;
double* dev_x;

cusparseHandle_t sparseHandle;
cusparseCreate(&sparseHandle);
cudaError error ;


cudaMalloc((void**)&dev_iA,(Abd+1)*sizeof(int));
cudaMalloc((void**)&dev_jA,(nzb)*sizeof(int));
cudaMalloc((void**)&dev_A,(Abd*bd*bd)*sizeof(double));
cudaMalloc((void**)&dev_b,Abd*bd*sizeof(double));
cudaMalloc((void**)&dev_x,Abd*bd*sizeof(double));


cudaMemcpy(dev_iA,iA,(Abd+1)*sizeof(int),cudaMemcpyHostToDevice);
cudaMemcpy(dev_jA,jA,nzb*sizeof(int),cudaMemcpyHostToDevice);
cudaMemcpy(dev_A,A,Abd*bd*bd*sizeof(double),cudaMemcpyHostToDevice);
cudaMemcpy(dev_x,x,Abd*bd*sizeof(double),cudaMemcpyHostToDevice);

double one=1;
double zero=0;

cusparseMatDescr_t descrC=NULL;
cusparseCreateMatDescr(&descrC);
cusparseSetMatType(descrC,CUSPARSE_MATRIX_TYPE_GENERAL);


cusparseDbsrmv(sparseHandle,CUSPARSE_DIRECTION_COLUMN,CUSPARSE_OPERATION_NON_TRANSPOSE,
				Abd,Abd,nzb,&one,descrC,dev_A,dev_iA,dev_jA,bd,dev_x,&zero,dev_b);


    cudaMemcpy(b,dev_b,Abd*bd*sizeof(double),cudaMemcpyDeviceToHost);


cudaFree(dev_iA);
cudaFree(dev_jA);
cudaFree(dev_A);
cudaFree(dev_x);
cudaFree(dev_b);

cusparseDestroy(sparseHandle);

}

Could you please check its result withc cuda-memcheck tool?