From b28ed06649cc92924725b109c12dac9fcd09d450 Mon Sep 17 00:00:00 2001 From: Jiacheng Xu <13862180016@163.com> Date: Tue, 3 Nov 2026 18:34:09 +0800 Subject: [PATCH] perf(lcao): batch full RI radial tables on CPU Route full two- and three-center radial table construction through the existing batched builders. The use_gpu argument selects CPU BLAS or CUDA, and three-center tables share product-orbital preparation. --- source/source_lcao/module_ri/matrix_orbs11.cpp | 14 ++------------ source/source_lcao/module_ri/matrix_orbs21.cpp | 14 ++------------ 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/source/source_lcao/module_ri/matrix_orbs11.cpp b/source/source_lcao/module_ri/matrix_orbs11.cpp index 6430faf746..f6af6b8686 100644 --- a/source/source_lcao/module_ri/matrix_orbs11.cpp +++ b/source/source_lcao/module_ri/matrix_orbs11.cpp @@ -103,24 +103,14 @@ void Matrix_Orbs11::init_radial_table(const bool use_gpu) for (auto& coD: coC.second) { for (auto& coE: coD.second) { for (auto& coF: coE.second) { - if (use_gpu) - { - orbitals.push_back(&coF.second); - } - else - { - coF.second.init_radial_table(); - } + orbitals.push_back(&coF.second); } } } } } } - if (use_gpu) - { - Center2_Orb::Orb11::init_radial_table(orbitals, true); - } + Center2_Orb::Orb11::init_radial_table(orbitals, use_gpu); ModuleBase::timer::end("Matrix_Orbs11", "init_radial_table"); } diff --git a/source/source_lcao/module_ri/matrix_orbs21.cpp b/source/source_lcao/module_ri/matrix_orbs21.cpp index 8ff0fa2fe9..42a0c20b27 100644 --- a/source/source_lcao/module_ri/matrix_orbs21.cpp +++ b/source/source_lcao/module_ri/matrix_orbs21.cpp @@ -139,14 +139,7 @@ void Matrix_Orbs21::init_radial_table(const bool use_gpu) { for (auto& coH: coG.second) { - if (use_gpu) - { - orbitals.push_back(&coH.second); - } - else - { - coH.second.init_radial_table(); - } + orbitals.push_back(&coH.second); } } } @@ -155,10 +148,7 @@ void Matrix_Orbs21::init_radial_table(const bool use_gpu) } } } - if (use_gpu) - { - Center2_Orb::Orb21::init_radial_table(orbitals, true); - } + Center2_Orb::Orb21::init_radial_table(orbitals, use_gpu); ModuleBase::timer::end("Matrix_Orbs21", "init_radial_table"); }