cublasCscal

i hace this code for

int main(void)
{
float *a_h,*a_d;

int i,j;    /*    Loop variables */
int n=3;        /* Number of equations */

// float x[N]; /* values of the variables i.e. x’s /
// char ch; /
choice inputing variable */

  //  printf("\nEnter the number of variables\n");
   // scanf("%d",&n);
        a_h=(float*)malloc(sizeof(float) * (n*(n+1)));
    for(i=0;i<n;i++)
    {
        for(j=0;j<(n+1);j++)
        {
          //  printf("\nEnter %d row %d col element\n",i+1,j+1);
           // scanf("%f",&a_h[i*(n+1)+j]);
          a_h[i*(n+1)+j]=i+j+2;
        }
    }

for(i=0;i<n;i++)
{
for(j=0;j<n+1;j++)
{
printf(“element is %f \n”,a_h[i*(n+1)+j]);
}
}
printf(“\n\n”);

int N;
N=n*(n+1);
cublasInit();
cublasAlloc(N,sizeof(float),(void**)&a_d);
cublasSetVector(N,sizeof(float),a_h,1,a_d,1);
for(i=0;i<n;i++)
{
float p=5.0;
//p=a_d[i*(n+1)+i];
cublasCscal(N,(void *)&p,a_d,1);
}
for(i=0;i<n;i++)
{
for(j=0;j<n+1;j++)
{
printf(“element is %f \n”,a_h[i*(n+1)+j]);
}
}
return 0;
}

now on compiling following error is coming
simpleCUBLAS.c: In function ‘main’:
simpleCUBLAS.c:43: error: incompatible type for argument 2 of ‘cublasCscal’
simpleCUBLAS.c:43: warning: passing argument 3 of ‘cublasCscal’ from incompatible pointer type

can someone help me with this…

The answer you are looking for is in the CUBLAS manual (page 29 of my copy)

void cublasCscal (int n, cuComplex alpha, cuComplex *x, int incx)

Seriously, doesn’t anyone read documentation any more?

I think he meant to use cublasSscal instead of cublasCscal…