Skip to content
Snippets Groups Projects
Commit 4a8cfbd6 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Extract only the necessary element from wk in j80 loop

parent d0ff91f2
No related branches found
No related tags found
No related merge requests found
...@@ -395,15 +395,18 @@ void frfme(string data_file, string output_path) { ...@@ -395,15 +395,18 @@ void frfme(string data_file, string output_path) {
for (int j80 = jlmf; j80 <= jlml; j80++) { for (int j80 = jlmf; j80 <= jlml; j80++) {
dcomplex *vec_w = new dcomplex[nkv * nkv](); dcomplex *vec_w = new dcomplex[nkv * nkv]();
dcomplex **w = new dcomplex*[nkv]; dcomplex **w = new dcomplex*[nkv];
dcomplex *wk_local = new dcomplex[nlmmt](); // dcomplex *wk_local = new dcomplex[nlmmt]();
for (int wi = 0; wi < nkv; wi++) w[wi] = vec_w + wi * nkv; for (int wi = 0; wi < nkv; wi++) w[wi] = vec_w + wi * nkv;
dcomplex wk_value;
int wk_index = 0; int wk_index = 0;
int nkvs = nkv * nkv; int nkvs = nkv * nkv;
for (int jy50 = 0; jy50 < nkv; jy50++) { for (int jy50 = 0; jy50 < nkv; jy50++) {
for (int jx50 = 0; jx50 < nkv; jx50++) { for (int jx50 = 0; jx50 < nkv; jx50++) {
for (int wi = 0; wi < nlmmt; wi++) wk_local[wi] = tt1->wk[wk_index++]; // for (int wi = 0; wi < nlmmt; wi++) wk_local[wi] = tt1->wk[wk_index++];
w[jx50][jy50] = wk_local[j80 - 1]; // w[jx50][jy50] = wk_local[j80 - 1];
// w[jx50][jy50] = tt1->wk[jy50 * nkvs + jx50 * nkv + j80 - 1]; wk_value = tt1->wk[wk_index + j80 - 1];
wk_index += nlmmt;
w[jx50][jy50] = wk_value;
} // jx50 } // jx50
} // jy50 loop } // jy50 loop
int ixyz = 0; int ixyz = 0;
...@@ -439,7 +442,7 @@ void frfme(string data_file, string output_path) { ...@@ -439,7 +442,7 @@ void frfme(string data_file, string output_path) {
} // iz75 loop } // iz75 loop
delete[] vec_w; delete[] vec_w;
delete[] w; delete[] w;
delete[] wk_local; // delete[] wk_local;
} // j80 loop } // j80 loop
#ifdef USE_NVTX #ifdef USE_NVTX
nvtxRangePop(); nvtxRangePop();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment