std::complex in cuda_la.cc and noncblas.cc
This commit is contained in:
parent
984c37721a
commit
5f1dd5f6e8
@ -48,15 +48,15 @@ double *gpuputdouble(const double &x){
|
|||||||
return (double *)ptr;
|
return (double *)ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
complex<double> *gpuputcomplex(const complex<double> &x){
|
std::complex<double> *gpuputcomplex(const std::complex<double> &x){
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
cublasAlloc(1, sizeof(complex<double>), &ptr);
|
cublasAlloc(1, sizeof(std::complex<double>), &ptr);
|
||||||
TEST_CUBLAS("cublasAlloc");
|
TEST_CUBLAS("cublasAlloc");
|
||||||
|
|
||||||
cublasSetVector(1, sizeof(complex<double>), &x, 1, ptr, 1);
|
cublasSetVector(1, sizeof(std::complex<double>), &x, 1, ptr, 1);
|
||||||
TEST_CUBLAS("cublasSetVector");
|
TEST_CUBLAS("cublasSetVector");
|
||||||
|
|
||||||
return (complex<double> *)ptr;
|
return (std::complex<double> *)ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -255,8 +255,8 @@ void cblas_zgerc(const CBLAS_ORDER Order, const int M, const int N,
|
|||||||
{
|
{
|
||||||
if(Order!=CblasRowMajor) laerror("CblasRowMajor order asserted");
|
if(Order!=CblasRowMajor) laerror("CblasRowMajor order asserted");
|
||||||
//conjugate y
|
//conjugate y
|
||||||
complex<double> *p;
|
std::complex<double> *p;
|
||||||
p= (complex<double> *) Y; for(int i=0; i<N; ++i) {p->imag() = -p->imag(); p+= incY;}
|
p= (std::complex<double> *) Y; for(int i=0; i<N; ++i) {p->imag(-p->imag()); p+= incY;}
|
||||||
#ifdef FORINT
|
#ifdef FORINT
|
||||||
const FINT mtmp=M;
|
const FINT mtmp=M;
|
||||||
const FINT ntmp=N;
|
const FINT ntmp=N;
|
||||||
@ -268,7 +268,7 @@ p= (complex<double> *) Y; for(int i=0; i<N; ++i) {p->imag() = -p->imag(); p+= in
|
|||||||
FORNAME(zgerc)(&N, &M, alpha, Y, &incY, X, &incX, A, &lda);
|
FORNAME(zgerc)(&N, &M, alpha, Y, &incY, X, &incX, A, &lda);
|
||||||
#endif
|
#endif
|
||||||
//conjugate y back
|
//conjugate y back
|
||||||
p= (complex<double> *) Y; for(int i=0; i<N; ++i) {p->imag() = -p->imag(); p+= incY;}
|
p= (std::complex<double> *) Y; for(int i=0; i<N; ++i) {p->imag(--p->imag()); p+= incY;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user