Hello,
After searching a long time and trying different method, I still can’t solve this problem.
I have two vectors: x = [a1,…,aN], y = [b1,…bN].
And I want to compute their inner product: <x,y> = a1conj(b1) + … + aNconj(bN). (conj(.) means conjugate operation)
I have tried cublasCdotu, and it just computes a1b1 + … + aNbN.
And cublasCdotc returns conj(a1)*conj(b1) + … + conj(aN)*conj(bN).
Finally, I tried thrust::inner_product, and it computes a1b1 + … + aNbN too.
My thrust code is like the following:
typedef thrust::complex comThr;
thrust::host_vector< comThr > x( vec_size );
thrust::generate(x.begin(), x.end(), rand);
thrust::host_vector< comThr > y( vec_size );
thrust::generate(y.begin(), y.end(), rand);
comThr z = thrust::inner_product(x.begin(), x.end(), y.begin(), comThr(0.0f,0.0f) );
Could you give me some advice on this problem? Thank you!