Skip to content

Commit

Permalink
simd
Browse files Browse the repository at this point in the history
  • Loading branch information
scemama committed Feb 14, 2024
1 parent 2228ab2 commit be2a719
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 16 deletions.
41 changes: 25 additions & 16 deletions org/qmckl_ao.org
Original file line number Diff line number Diff line change
Expand Up @@ -5882,7 +5882,9 @@ qmckl_compute_ao_value_hpc_gaussian (const qmckl_context context,
}
}

IVDEP
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (int64_t iprim = 0 ; iprim < nidx ; ++iprim) {
exp_mat[iprim] = exp(-ar2[iprim]);
}
Expand All @@ -5899,12 +5901,16 @@ IVDEP
}
}

IVDEP
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (int64_t iprim = 0 ; iprim < nidx ; ++iprim) {
exp_mat_sp[iprim] = expf(-ar2_sp[iprim]);
}

IVDEP
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (int64_t iprim = 0 ; iprim < nidx ; ++iprim) {
exp_mat[iprim] = exp_mat_sp[iprim];
}
Expand All @@ -5930,16 +5936,16 @@ IVDEP

const double s1 = ce_mat[ishell-ishell_start];

if (s1 == 0.0) {
continue;
}

const int64_t k = ao_index[ishell];
double* restrict const ao_value_1 = ao_value + ipoint_ao_num + k;

const int32_t l = shell_ang_mom[ishell];
const int32_t n = lstart[l+1]-lstart[l];

if (s1 == 0.0) {
continue;
}

double* restrict poly_vgl_1 = NULL;
if (nidx > 0) {
const double* restrict f = ao_factor + k;
Expand Down Expand Up @@ -5976,15 +5982,6 @@ IVDEP
}
break;
}
} else {
/*
#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (int64_t il=0 ; il<n ; ++il) {
ao_value_1[il] = 0.0;
}
*/
}
}
}
Expand Down Expand Up @@ -6685,6 +6682,9 @@ qmckl_compute_ao_vgl_hpc_gaussian (
}
}

#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (int64_t iprim = 0 ; iprim < nidx ; ++iprim) {
exp_mat[iprim][0] = exp(-ar2[iprim]);
}
Expand All @@ -6702,16 +6702,25 @@ qmckl_compute_ao_vgl_hpc_gaussian (
}
}

#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (int64_t iprim = 0 ; iprim < nidx ; ++iprim) {
exp_mat_sp[iprim] = expf(-ar2_sp[iprim]);
}

#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (int64_t iprim = 0 ; iprim < nidx ; ++iprim) {
exp_mat[iprim][0] = exp_mat_sp[iprim];
}

}

#ifdef HAVE_OPENMP
#pragma omp simd
#endif
for (int64_t iprim = 0 ; iprim < nidx ; ++iprim) {
double f = qmckl_mat(expo_per_nucleus, iprim, inucl) * exp_mat[iprim][0];
f = -f-f;
Expand Down
26 changes: 26 additions & 0 deletions org/qmckl_jastrow_champ.org
Original file line number Diff line number Diff line change
Expand Up @@ -6647,6 +6647,19 @@ end function qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_f
double* const een_rescaled_e_gl );
#+end_src

#+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none
qmckl_exit_code qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_doc (
const qmckl_context context,
const int64_t walk_num,
const int64_t elec_num,
const int64_t cord_num,
const double rescale_factor_ee,
const double* coord_ee,
const double* ee_distance,
const double* een_rescaled_e,
double* const een_rescaled_e_gl );
#+end_src


#+CALL: generate_c_interface(table=qmckl_factor_een_rescaled_e_gl_args,rettyp=get_value("CRetType"),fname=get_value("Name"))

Expand Down Expand Up @@ -6692,6 +6705,19 @@ end function qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_f
end function qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_doc
#+end_src

#+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none
qmckl_exit_code qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_hpc (
const qmckl_context context,
const int64_t walk_num,
const int64_t elec_num,
const int64_t cord_num,
const double rescale_factor_ee,
const double* coord_ee,
const double* ee_distance,
const double* een_rescaled_e,
double* const een_rescaled_e_gl );
#+end_src

#+begin_src c :comments org :tangle (eval c) :noweb yes
qmckl_exit_code qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_hpc (
const qmckl_context context,
Expand Down

0 comments on commit be2a719

Please sign in to comment.