sample Thrust program not working

Created below codes following Thrust tutorial, for “multiple”.
But the results array didn’t get populated correctly…

cudaMalloc((void**)&d_cdata ,d * iNumPaths*sizeof(double));
cudaMalloc((void**)&d_cdataMulti ,d * iNumPaths*sizeof(double));
cudaMemcpy(d_cdata, cdata, d * iNumPaths*sizeof(double), cudaMemcpyHostToDevice);

thrust::device_ptr<double> t_d_cdata(d_cdata);
thrust::device_ptr<double> t_d_cdataMulti(d_cdataMulti);

thrust::transform(t_d_cdata, t_d_cdata+d * iNumPaths, t_d_cdataMulti,t_d_cdataMulti, thrust::multiplies<double>());

thrust::copy(t_d_cdata,t_d_cdata+d * iNumPaths, std::ostream_iterator<double>(std::cout, "\n"));
thrust::copy(t_d_cdataMulti,t_d_cdataMulti+d * iNumPaths, std::ostream_iterator<double>(std::cout, "\n"));

Got answer myself.
the 3rd param to “transform” should still be input, instead of output.
Thanks.