Skip to content
Snippets Groups Projects
Commit 4a555900 authored by Jan Thorbecke's avatar Jan Thorbecke
Browse files

general

parent 05dfa2d5
No related branches found
No related tags found
No related merge requests found
...@@ -67,6 +67,7 @@ void ccmfft(complex *data, int n1, int n2, int ld1, int sign) ...@@ -67,6 +67,7 @@ void ccmfft(complex *data, int n1, int n2, int ld1, int sign)
static DFTI_DESCRIPTOR_HANDLE handle=0; static DFTI_DESCRIPTOR_HANDLE handle=0;
static int nprev=0; static int nprev=0;
MKL_LONG Status; MKL_LONG Status;
int j;
#endif #endif
#if defined(HAVE_LIBSCS) #if defined(HAVE_LIBSCS)
...@@ -114,12 +115,12 @@ void ccmfft(complex *data, int n1, int n2, int ld1, int sign) ...@@ -114,12 +115,12 @@ void ccmfft(complex *data, int n1, int n2, int ld1, int sign)
nprev = n1; nprev = n1;
} }
if (sign < 0) { if (sign < 0) {
for (int j=0; j<n2; j++) { for (j=0; j<n2; j++) {
Status = DftiComputeBackward(handle, &data[j*ld1]); Status = DftiComputeBackward(handle, &data[j*ld1]);
} }
} }
else { else {
for (int j=0; j<n2; j++) { for (j=0; j<n2; j++) {
Status = DftiComputeForward(handle, &data[j*ld1]); Status = DftiComputeForward(handle, &data[j*ld1]);
} }
} }
......
...@@ -61,6 +61,7 @@ void cr1fft(complex *cdata, REAL *rdata, int n, int sign) ...@@ -61,6 +61,7 @@ void cr1fft(complex *cdata, REAL *rdata, int n, int sign)
static int nprev=0; static int nprev=0;
REAL *tmp; REAL *tmp;
MKL_LONG Status; MKL_LONG Status;
int i;
#endif #endif
#if defined(HAVE_LIBSCS) #if defined(HAVE_LIBSCS)
...@@ -132,7 +133,7 @@ void cr1fft(complex *cdata, REAL *rdata, int n, int sign) ...@@ -132,7 +133,7 @@ void cr1fft(complex *cdata, REAL *rdata, int n, int sign)
printf(" DftiComputeBackward FAIL\n"); printf(" DftiComputeBackward FAIL\n");
} }
rdata[0] = tmp[0]; rdata[0] = tmp[0];
for (int i=1; i<n; i++) { for (i=1; i<n; i++) {
rdata[i] = -sign*tmp[n-i]; rdata[i] = -sign*tmp[n-i];
} }
free(tmp); free(tmp);
......
...@@ -75,6 +75,7 @@ void crmfft(complex *cdata, REAL *rdata, int n1, int n2, int ldc, int ldr, int s ...@@ -75,6 +75,7 @@ void crmfft(complex *cdata, REAL *rdata, int n1, int n2, int ldc, int ldr, int s
static int nprev=0; static int nprev=0;
REAL *tmp; REAL *tmp;
MKL_LONG Status; MKL_LONG Status;
int i, j;
#endif #endif
#if defined(HAVE_LIBSCS) #if defined(HAVE_LIBSCS)
...@@ -166,10 +167,10 @@ void crmfft(complex *cdata, REAL *rdata, int n1, int n2, int ldc, int ldr, int s ...@@ -166,10 +167,10 @@ void crmfft(complex *cdata, REAL *rdata, int n1, int n2, int ldc, int ldr, int s
nprev = n1; nprev = n1;
} }
tmp = (float *)malloc(n1*sizeof(float)); tmp = (float *)malloc(n1*sizeof(float));
for (int j=0; j<n2; j++) { for (j=0; j<n2; j++) {
Status = DftiComputeBackward(handle, (MKL_Complex8 *)&cdata[j*ldc], tmp); Status = DftiComputeBackward(handle, (MKL_Complex8 *)&cdata[j*ldc], tmp);
rdata[j*ldr] = tmp[0]; rdata[j*ldr] = tmp[0];
for (int i=1; i<n1; i++) { for (i=1; i<n1; i++) {
rdata[j*ldr+i] = -sign*tmp[n1-i]; rdata[j*ldr+i] = -sign*tmp[n1-i];
} }
} }
......
...@@ -60,6 +60,7 @@ void rc1fft(REAL *rdata, complex *cdata, int n, int sign) ...@@ -60,6 +60,7 @@ void rc1fft(REAL *rdata, complex *cdata, int n, int sign)
static DFTI_DESCRIPTOR_HANDLE handle=0; static DFTI_DESCRIPTOR_HANDLE handle=0;
static int nprev=0; static int nprev=0;
MKL_LONG Status; MKL_LONG Status;
int i;
#endif #endif
#if defined(HAVE_LIBSCS) #if defined(HAVE_LIBSCS)
...@@ -132,7 +133,7 @@ void rc1fft(REAL *rdata, complex *cdata, int n, int sign) ...@@ -132,7 +133,7 @@ void rc1fft(REAL *rdata, complex *cdata, int n, int sign)
dfti_status_print(Status); dfti_status_print(Status);
printf(" DftiComputeForward FAIL\n"); printf(" DftiComputeForward FAIL\n");
} }
for (int i=1; i<((n-1)/2)+1; i++) { for (i=1; i<((n-1)/2)+1; i++) {
cdata[i].i *= -sign; cdata[i].i *= -sign;
} }
......
...@@ -72,6 +72,7 @@ void rcmfft(REAL *rdata, complex *cdata, int n1, int n2, int ldr, int ldc, int s ...@@ -72,6 +72,7 @@ void rcmfft(REAL *rdata, complex *cdata, int n1, int n2, int ldr, int ldc, int s
static DFTI_DESCRIPTOR_HANDLE handle=0; static DFTI_DESCRIPTOR_HANDLE handle=0;
static int nprev=0; static int nprev=0;
MKL_LONG Status; MKL_LONG Status;
int i,j;
#endif #endif
#if defined(HAVE_LIBSCS) #if defined(HAVE_LIBSCS)
...@@ -160,9 +161,9 @@ void rcmfft(REAL *rdata, complex *cdata, int n1, int n2, int ldr, int ldc, int s ...@@ -160,9 +161,9 @@ void rcmfft(REAL *rdata, complex *cdata, int n1, int n2, int ldr, int ldc, int s
dfti_status_print(Status); dfti_status_print(Status);
printf(" DftiComputeForward FAIL\n"); printf(" DftiComputeForward FAIL\n");
} }
for (int j=0; j<n2; j++) { for (j=0; j<n2; j++) {
Status = DftiComputeForward(handle, &rdata[j*ldr], (MKL_Complex8 *)&cdata[j*ldc]); Status = DftiComputeForward(handle, &rdata[j*ldr], (MKL_Complex8 *)&cdata[j*ldc]);
for (int i=1; i<((n1-1)/2)+1; i++) { for (i=1; i<((n1-1)/2)+1; i++) {
cdata[j*ldc+i].i *= -sign; cdata[j*ldc+i].i *= -sign;
} }
} }
......
...@@ -47,7 +47,7 @@ OPTC += -fopenmp ...@@ -47,7 +47,7 @@ OPTC += -fopenmp
### Linux ### Linux
##OPTC = -O3 -no-prec-div -qopt-report-phase=vec,openmp ##OPTC = -O3 -no-prec-div -qopt-report-phase=vec,openmp
##OPTF = -O3 -no-prec-div -qopt-report-phase=vec,openmp ##OPTF = -O3 -no-prec-div -qopt-report-phase=vec,openmp
#OPTC = -O3 -no-prec-div -xCORE-AVX2 #OPTC = -O3 -no-prec-div -xCORE-AVX2
#OPTF = -O3 -no-prec-div -xCORE-AVX2 #OPTF = -O3 -no-prec-div -xCORE-AVX2
##to include parallelisation with OpenMP ##to include parallelisation with OpenMP
#OPTC += -qopenmp #OPTC += -qopenmp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment