i am new to cuda programming and i was developing a code which will just pass some arrays and complex numbers from host to device but when i am compiling it, it gives me errors like this:

error (39): no suitable constructor exists to convert from “void *” to “float2”

error (82): argument of type “float” is incompatible with parameter of type “void *”

error (82): argument of type “float” is incompatible with parameter of type “const void *”

here is my code :

```
#include <cuda.h>
#include <bits/stdc++.h>
#include <cuComplex.h>
#include <thrust/complex.h>
//#include <helper_functions.h>
//#include <helper_cuda.h>
#include <cuda_runtime.h>
using namespace std;
typedef float2 Complex;
__device__ inline Complex ComplexScale(Complex a, float s)
{
Complex c;
c.x = s * a.x;
c.y = s * a.y;
return c;
}
#define N 5
/*__global__ void matrixA(float* A, float* B, float* C){
int i = threadIdx.x;
int j = blockIdx.x;
C[N*j+i] = A[N*j+i] + B[N*j+i];
}*/
int main (void) {
float a[N][5],b[N],c,ay[N][5],by[N],omega=20,damp_fac=0.05;;
float *dev_a, *dev_b, dev_dfac, dev_omega;
Complex dev_pratio, dev_csv, dev_sheer;
c=1/4;
Complex z=(Complex)malloc(sizeof(Complex));
z.x=1.0;
z.y=damp_fac;
Complex poisson_ratio = (Complex)malloc(sizeof(Complex));
poisson_ratio = ComplexScale(z,0.3);
Complex c_sv = (Complex)malloc(sizeof(Complex));
c_sv = ComplexScale(z,200.00);
Complex sheermodulus = (Complex)malloc(sizeof(Complex));
sheermodulus = ComplexScale(z,7e+7);
cudaMalloc((void **)&dev_a, N * 5 * sizeof(float));
cudaMalloc((void **)&dev_b, N * sizeof(float));
cudaMalloc((void **)&dev_dfac, sizeof(float));
cudaMalloc((void **)&dev_omega, sizeof(float));
cudaMalloc((void **)&dev_pratio, sizeof(Complex));
cudaMalloc((void **)&dev_csv, sizeof(Complex));
cudaMalloc((void **)&dev_sheer, sizeof(Complex));
for (int i = 0; i < N; i++){
for (int j = 0; j < 5; j++){
if(i==0 && j==0)
a[i][j] = 0.0;
else if(j==0 && i!=0)
a[i][j]=a[--i][4];
else
a[i][j]=a[i][--j]+c;
}
}
for (int i = 0; i < N; i++){
by[i]=0.0;
for (int j = 0; j < 5; j++){
ay[i][j]=0.0;
}
}
for(int i=0;i<N;i++)
{
b[i]=a[i][2];
}
cudaMemcpy(dev_a, a, N * 5 * sizeof(float), cudaMemcpyHostToDevice);
cudaMemcpy(dev_b, b, N * sizeof(float), cudaMemcpyHostToDevice);
cudaMemcpy(dev_dfac, damp_fac, sizeof(float), cudaMemcpyHostToDevice);
cudaMemcpy(dev_omega, omega, sizeof(float), cudaMemcpyHostToDevice);
cudaMemcpy(dev_pratio, poisson_ratio, sizeof(Complex), cudaMemcpyHostToDevice);
cudaMemcpy(dev_csv, c_sv, sizeof(Complex), cudaMemcpyHostToDevice);
cudaMemcpy(dev_sheer, sheermodulus, sizeof(Complex), cudaMemcpyHostToDevice);
//matrixAdd <<<N,5>>> (dev_a, dev_b, dev_c);
//cudaMemcpy(c, dev_c, N * N * sizeof(float), cudaMemcpyDeviceToHost);
return 0;
}
```

Please help!