void complexVector::axpy(const Real alpha, const complexVector& x) { assert( x.length() == length() ); int N=2*length(); BLASRPFX(axpy,BLASINT(N),BLASREAL(alpha),BLASPREAL(x.data()),BLASINT(mnlIntOne),BLASPREAL(v_data),BLASINT(mnlIntOne)); }
void GridGpu::gridding(complexVector &trajData) { if (trajData.size() != m_kSize) qCritical() << "Size of k-space data not equal to the size of trajactory."; transferData(trajData); cudaError_t status = kernelCall(); if (status != cudaSuccess) qWarning() << cudaGetErrorString(status); }
cudaError_t GridGpu::retrieveData(complexVector &gData) { gData.resize(m_gridSize * m_gridSize); cudaMemcpy(gData.data(), m_d_gData, gData.size() * sizeof(complexGpu), cudaMemcpyDeviceToHost); return cudaGetLastError(); }
cudaError_t GridGpu::transferData(complexVector &trajData) { cudaMemcpy(m_d_trajData, trajData.data(), trajData.size() * sizeof(complexGpu), cudaMemcpyHostToDevice); return cudaGetLastError(); }
void complexVector::operator -=(const complexVector& v2) { assert( v2.length()==length() ); BLASCPFX(axpy,BLASINT(m_N),BLASCOMPLEX(mnlComplexMinusOne),BLASPCOMPLEX(v2.data()),BLASINT(mnlIntOne),BLASPCOMPLEX(v_data),BLASINT(mnlIntOne)); }
void complexVector::gemv(const complexVector& x, const complexMatrix& A, const char trans, const std::complex<Real> alpha, const std::complex<Real> beta) { BLASCPFX(gemv,BLASCHAR(trans),BLASINT(A.rows()),BLASINT(A.cols()),BLASCOMPLEX(alpha),BLASPCOMPLEX(A.data()[0]),BLASINT(A.rows()),BLASPCOMPLEX(x.data()),BLASINT(mnlIntOne),BLASCOMPLEX(beta),BLASPCOMPLEX(data()),BLASINT(mnlIntOne)); }
void complexVector::gemv(const complexVector& x, const Matrix& A, const char trans, const Real alpha, const Real beta) { BLASRPFX(gemv,BLASCHAR(trans),BLASINT(A.rows()),BLASINT(A.cols()),BLASREAL(alpha),BLASPREAL(A.data()[0]),BLASINT(A.rows()),BLASPREAL(x.data()),BLASINT(mnlIntTwo),BLASREAL(beta),BLASPREAL(data()),BLASINT(mnlIntTwo)); BLASRPFX(gemv,BLASCHAR(trans),BLASINT(A.rows()),BLASINT(A.cols()),BLASREAL(alpha),BLASPREAL(A.data()[0]),BLASINT(A.rows()),BLASPREAL(x.data())+1,BLASINT(mnlIntTwo),BLASREAL(beta),BLASPREAL(data())+1,BLASINT(mnlIntTwo)); }
void complexVector::axpy(const std::complex<Real> alpha, const complexVector& x) { assert( x.length() == length() ); BLASCPFX(axpy,BLASINT(m_N),BLASCOMPLEX(alpha),BLASPCOMPLEX(x.data()),BLASINT(mnlIntOne),BLASPCOMPLEX(v_data),BLASINT(mnlIntOne)); }
complexVector::complexVector(const string& n_name, const complexVector& vector) : basicVector< std::complex<Real> >(n_name,vector.length(),false,const_cast<std::complex<Real>*>(vector.data())) { }