Commit 1ec934b8 authored by Pavel Kus's avatar Pavel Kus Committed by Andreas Marek

fixing single precission complex on Minsky

parent 14fed421
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
#include <time.h> #include <time.h>
#include <alloca.h> #include <alloca.h>
#include <stdint.h> #include <stdint.h>
#include <complex.h>
#include <cublas.h>
#include "config-f90.h" #include "config-f90.h"
...@@ -185,5 +187,37 @@ extern "C" { ...@@ -185,5 +187,37 @@ extern "C" {
int val = cudaHostRegisterMapped; int val = cudaHostRegisterMapped;
return val; return val;
} }
void CUBLASWINAPI cublasCgemv_elpa_wrapper (char trans, int m, int n, float complex alpha,
const cuFloatComplex *A, int lda, const cuFloatComplex *x, int incx,
  • Why is this a cuFloatComplex for A? Wouldn't it be more consistent if we used also there float complex?

  • I have changed it with a new commit. If you like it more, I will do the same for complex double

  • Yes, please do the same as for double complex

Please register or sign in to reply
float complex beta, cuFloatComplex *y, int incy) {
cuFloatComplex alpha_casted = {crealf(alpha), cimagf(alpha)};
cuFloatComplex beta_casted = {crealf(beta), cimagf(beta)};
cublasCgemv(trans, m, n, alpha_casted, A, lda, x, incx, beta_casted, y, incy);
}
void CUBLASWINAPI cublasCgemm_elpa_wrapper (char transa, char transb, int m, int n, int k,
float complex alpha, const cuComplex *A, int lda,
const cuComplex *B, int ldb, float complex beta,
cuComplex *C, int ldc) {
cuFloatComplex alpha_casted = {crealf(alpha), cimagf(alpha)};
cuFloatComplex beta_casted = {crealf(beta), cimagf(beta)};
cublasCgemm(transa, transb, m, n, k, alpha_casted, A, lda, B, ldb, beta_casted, C, ldc);
}
void CUBLASWINAPI cublasCtrmm_elpa_wrapper (char side, char uplo, char transa, char diag,
int m, int n, float complex alpha, const cuComplex *A,
int lda, cuComplex *B, int ldb){
cuFloatComplex alpha_casted = {crealf(alpha), cimagf(alpha)};
cublasCtrmm(side, uplo, transa, diag, m, n, alpha_casted, A, lda, B, ldb);
}
} }
#endif /* WITH_GPU_VERSION */ #endif /* WITH_GPU_VERSION */
...@@ -310,7 +310,7 @@ module cuda_functions ...@@ -310,7 +310,7 @@ module cuda_functions
end interface end interface
interface interface
subroutine cublas_cgemm_c(cta, ctb, m, n, k, alpha, a, lda, b, ldb, beta, c,ldc) bind(C,name='cublasCgemm') subroutine cublas_cgemm_c(cta, ctb, m, n, k, alpha, a, lda, b, ldb, beta, c,ldc) bind(C,name='cublasCgemm_elpa_wrapper')
use iso_c_binding use iso_c_binding
...@@ -340,7 +340,7 @@ module cuda_functions ...@@ -340,7 +340,7 @@ module cuda_functions
end interface end interface
interface interface
subroutine cublas_ctrmm_c(side, uplo, trans, diag, m, n, alpha, a, lda, b, ldb) bind(C,name='cublasCtrmm') subroutine cublas_ctrmm_c(side, uplo, trans, diag, m, n, alpha, a, lda, b, ldb) bind(C,name='cublasCtrmm_elpa_wrapper')
use iso_c_binding use iso_c_binding
...@@ -397,7 +397,7 @@ module cuda_functions ...@@ -397,7 +397,7 @@ module cuda_functions
end interface end interface
interface interface
subroutine cublas_cgemv_c(cta, m, n, alpha, a, lda, x, incx, beta, y, incy) bind(C,name='cublasCgemv') subroutine cublas_cgemv_c(cta, m, n, alpha, a, lda, x, incx, beta, y, incy) bind(C,name='cublasCgemv_elpa_wrapper')
use iso_c_binding use iso_c_binding
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment