From dbb49a2df5e11752bec65ba9a0080ea5feaa5996 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 28 Nov 2023 23:37:15 +0100 Subject: [PATCH] Introduced SP in ao->mo --- org/qmckl_mo.org | 127 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/org/qmckl_mo.org b/org/qmckl_mo.org index 64bafa3..1382024 100644 --- a/org/qmckl_mo.org +++ b/org/qmckl_mo.org @@ -1270,6 +1270,117 @@ qmckl_compute_mo_basis_mo_value_hpc (const qmckl_context context, #+begin_src c :tangle (eval c) :comments org #ifdef HAVE_HPC qmckl_exit_code +qmckl_compute_mo_basis_mo_value_hpc_sp (const qmckl_context context, + const int64_t ao_num, + const int64_t mo_num, + const int64_t point_num, + const double* restrict coefficient_t, + const double* restrict ao_value, + double* restrict const mo_value ) +{ + assert (context != QMCKL_NULL_CONTEXT); + + float* coefficient_t_sp = calloc(mo_num, sizeof(float)); + if (coefficient_t_sp == NULL) { + return qmckl_failwith( context, + QMCKL_ALLOCATION_FAILED, + "qmckl_compute_mo_basis_mo_vgl_hpc_sp", + "coefficient_t_sp"); + }; + + IVDEP +#ifdef HAVE_OPENMP +#pragma omp simd +#endif + for (int64_t i=0 ; inumprec.precision; + const bool single_precision = precision <= 23; + + if (single_precision) { + return qmckl_compute_mo_basis_mo_value_hpc_sp (context, + ao_num, + mo_num, + point_num, + coefficient_t, + ao_value, + mo_value ); + } #ifdef HAVE_OPENMP #pragma omp parallel for