├── .github └── workflows │ ├── build_and_test_compiler_zoo.yml │ ├── scripts │ └── compiler_setup.sh │ └── toolchains │ └── gh-actions.cmake ├── .gitignore ├── CMakeLists.txt ├── LICENSE.txt ├── README.md ├── attic ├── include │ └── gauxc │ │ ├── new_xc_integrator │ │ ├── impl.hpp │ │ ├── integrator_factory.hpp │ │ ├── replicated │ │ │ ├── impl.hpp │ │ │ ├── incore_xc_device_integrator.hpp │ │ │ ├── reference_xc_host_integrator.hpp │ │ │ ├── replicated_xc_integrator_impl.hpp │ │ │ └── shellbatched_xc_device_integrator.hpp │ │ ├── replicated_xc_integrator.hpp │ │ ├── xc_integrator_impl.hpp │ │ └── xc_integrator_state.hpp │ │ ├── util │ │ └── forward_as_shared_ptr.hpp │ │ └── xc_integrator │ │ ├── impl.hpp │ │ ├── incore_xc_cuda_integrator.hpp │ │ ├── integrator_defaults.hpp │ │ ├── integrator_factory.hpp │ │ ├── reference_xc_host_integrator.hpp │ │ ├── shellbatched_xc_cuda_integrator.hpp │ │ ├── xc_cuda_data.hpp │ │ ├── xc_cuda_util.hpp │ │ ├── xc_host_data.hpp │ │ ├── xc_host_util.hpp │ │ ├── xc_integrator_impl.hpp │ │ └── xc_integrator_state.hpp ├── src │ ├── integrator │ │ ├── CMakeLists.txt │ │ ├── cuda │ │ │ ├── buffer_adaptor.hpp │ │ │ ├── collocation │ │ │ │ ├── collocation_angular_cartesian.hpp │ │ │ │ ├── collocation_angular_spherical_unnorm.hpp │ │ │ │ ├── collocation_device_constants.hpp │ │ │ │ ├── collocation_radial.hpp │ │ │ │ ├── deprecated │ │ │ │ │ ├── gaueval_kernels_template.cu │ │ │ │ │ └── generate_bfeval.py │ │ │ │ ├── scripts │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── collocation_angular.py │ │ │ │ │ └── generate_collocation_angular_eval.py │ │ │ │ └── templates │ │ │ │ │ ├── collocation_angular_template.hpp │ │ │ │ │ └── collocation_device_constants_template.hpp │ │ │ ├── collocation_device.cu │ │ │ ├── collocation_device.hpp │ │ │ ├── collocation_masked_combined_kernels.hpp │ │ │ ├── collocation_masked_kernels.hpp │ │ │ ├── collocation_petite_combined_kernels.hpp │ │ │ ├── collocation_petite_kernels.hpp │ │ │ ├── cublas_extensions.cu │ │ │ ├── cublas_extensions.hpp │ │ │ ├── cuda_alg_variant_control.hpp │ │ │ ├── cuda_device_properties.cxx │ │ │ ├── cuda_device_properties.hpp │ │ │ ├── cuda_driver_replicated_density_incore.cxx │ │ │ ├── cuda_driver_replicated_density_shellbatched.cxx │ │ │ ├── cuda_eval_denvars.cu │ │ │ ├── cuda_eval_denvars.hpp │ │ │ ├── cuda_extensions.hpp │ │ │ ├── cuda_inc_potential.cu │ │ │ ├── cuda_inc_potential.hpp │ │ │ ├── cuda_pack_density.cu │ │ │ ├── cuda_pack_density.hpp │ │ │ ├── cuda_weights.cu │ │ │ ├── cuda_weights.hpp │ │ │ ├── cuda_zmat.cu │ │ │ ├── cuda_zmat.hpp │ │ │ ├── gauxc-cuda_integrator.cmake │ │ │ └── xc_cuda_data.cxx │ │ ├── host │ │ │ ├── blas.cxx │ │ │ ├── blas.hpp │ │ │ ├── gauxc-host_integrator.cmake │ │ │ ├── host_collocation.cxx │ │ │ ├── host_collocation.hpp │ │ │ ├── host_weights.cxx │ │ │ ├── host_weights.hpp │ │ │ ├── host_zmat.cxx │ │ │ ├── host_zmat.hpp │ │ │ ├── util.hpp │ │ │ └── xc_host_util.cxx │ │ ├── integrator_common.cxx │ │ ├── integrator_common.hpp │ │ └── integrator_constants.hpp │ ├── load_balancer_defaults.hpp │ └── new_integrator │ │ ├── CMakeLists.txt │ │ ├── common │ │ ├── gauxc-common.cmake │ │ ├── integrator_common.cxx │ │ ├── integrator_common.hpp │ │ └── integrator_constants.hpp │ │ ├── device │ │ ├── buffer_adaptor.hpp │ │ ├── cuda │ │ │ ├── collocation │ │ │ │ ├── collocation_angular_cartesian.hpp │ │ │ │ ├── collocation_angular_spherical_unnorm.hpp │ │ │ │ ├── collocation_device_constants.hpp │ │ │ │ ├── collocation_radial.hpp │ │ │ │ ├── deprecated │ │ │ │ │ ├── gaueval_kernels_template.cu │ │ │ │ │ └── generate_bfeval.py │ │ │ │ ├── scripts │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── collocation_angular.py │ │ │ │ │ └── generate_collocation_angular_eval.py │ │ │ │ └── templates │ │ │ │ │ ├── collocation_angular_template.hpp │ │ │ │ │ └── collocation_device_constants_template.hpp │ │ │ ├── collocation_device.cu │ │ │ ├── collocation_device.hpp │ │ │ ├── collocation_masked_combined_kernels.hpp │ │ │ ├── collocation_masked_kernels.hpp │ │ │ ├── collocation_petite_combined_kernels.hpp │ │ │ ├── collocation_petite_kernels.hpp │ │ │ ├── cublas_extensions.cu │ │ │ ├── cublas_extensions.hpp │ │ │ ├── cuda_alg_variant_control.hpp │ │ │ ├── cuda_device_properties.cxx │ │ │ ├── cuda_device_properties.hpp │ │ │ ├── cuda_eval_denvars.cu │ │ │ ├── cuda_eval_denvars.hpp │ │ │ ├── cuda_extensions.hpp │ │ │ ├── cuda_inc_potential.cu │ │ │ ├── cuda_inc_potential.hpp │ │ │ ├── cuda_pack_density.cu │ │ │ ├── cuda_pack_density.hpp │ │ │ ├── cuda_weights.cu │ │ │ ├── cuda_weights.hpp │ │ │ ├── cuda_zmat.cu │ │ │ ├── cuda_zmat.hpp │ │ │ ├── gauxc-cuda.cmake │ │ │ ├── local_work_replicated_incore_exc_vxc.cxx │ │ │ ├── local_work_replicated_incore_exc_vxc.hpp │ │ │ ├── xc_cuda_data.cxx │ │ │ └── xc_cuda_data.hpp │ │ ├── gauxc-device.cmake │ │ ├── hip │ │ │ ├── collocation │ │ │ │ ├── collocation_angular_cartesian.hpp │ │ │ │ ├── collocation_angular_spherical_unnorm.hpp │ │ │ │ ├── collocation_device_constants.hpp │ │ │ │ └── collocation_radial.hpp │ │ │ ├── collocation_device.hip │ │ │ ├── collocation_device.hpp │ │ │ ├── collocation_masked_combined_kernels.hpp │ │ │ ├── collocation_masked_kernels.hpp │ │ │ ├── collocation_petite_combined_kernels.hpp │ │ │ ├── collocation_petite_kernels.hpp │ │ │ ├── gauxc-hip.cmake │ │ │ ├── hip_alg_variant_control.hpp │ │ │ ├── hip_device_properties.cxx │ │ │ ├── hip_device_properties.hip │ │ │ ├── hip_eval_denvars.hip │ │ │ ├── hip_eval_denvars.hpp │ │ │ ├── hip_extensions.hpp │ │ │ ├── hip_inc_potential.hip │ │ │ ├── hip_inc_potential.hpp │ │ │ ├── hip_pack_density.hip │ │ │ ├── hip_pack_density.hpp │ │ │ ├── hip_weights.hip │ │ │ ├── hip_weights.hpp │ │ │ ├── hip_zmat.hip │ │ │ ├── hip_zmat.hpp │ │ │ ├── hipblas_extensions.hip │ │ │ ├── hipblas_extensions.hpp │ │ │ ├── hipify-integrator.sh │ │ │ ├── local_work_replicated_incore_exc_vxc.cxx │ │ │ ├── local_work_replicated_incore_exc_vxc.hpp │ │ │ └── xc_hip_data.cxx │ │ ├── incore_xc_device_exc_vxc.hpp │ │ ├── incore_xc_device_integrator.cxx │ │ ├── local_work_replicated_incore_exc_vxc.hpp │ │ ├── local_work_replicated_shellbatched_exc_vxc.cxx │ │ ├── local_work_replicated_shellbatched_exc_vxc.hpp │ │ ├── shellbatched_xc_device_exc_vxc.hpp │ │ ├── shellbatched_xc_device_integrator.cxx │ │ └── xc_device_data.hpp │ │ ├── host │ │ ├── blas.cxx │ │ ├── blas.hpp │ │ ├── gauxc-host.cmake │ │ ├── host_collocation.cxx │ │ ├── host_collocation.hpp │ │ ├── host_exc_vxc_zmat.cxx │ │ ├── host_exc_vxc_zmat.hpp │ │ ├── host_weights.cxx │ │ ├── host_weights.hpp │ │ ├── local_work_replicated_exc_vxc.cxx │ │ ├── local_work_replicated_exc_vxc.hpp │ │ ├── reference_xc_host_exc_vxc.hpp │ │ ├── reference_xc_host_integrator.cxx │ │ ├── util.hpp │ │ └── xc_host_data.hpp │ │ ├── replicated │ │ └── gauxc-replicated.cmake │ │ └── replicated_xc_integrator_impl.cxx └── tests │ └── collocation_cuda.hpp ├── cmake ├── BuildFindCereal.cmake ├── gauxc-cereal.cmake ├── gauxc-config.cmake.in ├── gauxc-cub.cmake ├── gauxc-cutlass.cmake ├── gauxc-dep-versions.cmake ├── gauxc-eigen3.cmake ├── gauxc-exchcxx.cmake ├── gauxc-gau2grid.cmake ├── gauxc-integratorxx.cmake ├── gauxc-linalg-modules.cmake └── modules │ ├── FindMAGMA.cmake │ └── FindNCCL.cmake ├── external └── gau2grid │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.txt │ ├── generated_source │ ├── gau2grid │ │ ├── gau2grid.h │ │ ├── gau2grid_pragma.h │ │ └── gau2grid_utility.h │ ├── gau2grid_deriv1.c │ ├── gau2grid_deriv2.c │ ├── gau2grid_deriv3.c │ ├── gau2grid_helper.c │ ├── gau2grid_orbital.c │ ├── gau2grid_phi.c │ └── gau2grid_transform.c │ └── src │ ├── .clang-format │ ├── .codecov.yml │ ├── .gitignore │ ├── .lgtm.yml │ ├── .travis.yml │ ├── CMakeLists.txt │ ├── LICENSE │ ├── MANIFEST.in │ ├── README.md │ ├── appveyor.yml │ ├── cmake │ ├── FindPythonLibsNew.cmake │ ├── FindStandardMathLibraryC.cmake │ ├── autocmake_safeguards.cmake │ ├── custom_color_messages.cmake │ ├── custom_static_library.cmake │ ├── gau2gridConfig.cmake.in │ └── psi4OptionsTools.cmake │ ├── devtools │ ├── README.md │ ├── conda-envs │ │ └── base.yaml │ └── scripts │ │ └── conda_env.py │ ├── docs │ ├── Makefile │ ├── requirements.yml │ └── source │ │ ├── c_api.rst │ │ ├── c_example.rst │ │ ├── c_install.rst │ │ ├── conf.py │ │ ├── index.rst │ │ ├── order.rst │ │ ├── py_api.rst │ │ ├── py_example.rst │ │ └── py_install.rst │ ├── gau2grid │ ├── RSH.py │ ├── __init__.py │ ├── _version.py │ ├── c_generator.py │ ├── c_pragma.py │ ├── c_util_generator.py │ ├── c_wrapper.py │ ├── codegen.py │ ├── docs_generator.py │ ├── extras.py │ ├── order.py │ ├── python_reference.py │ ├── tests │ │ ├── __init__.py │ │ ├── ref_basis.py │ │ ├── test_c_code.py │ │ ├── test_c_generator.py │ │ ├── test_helper.py │ │ ├── test_order.py │ │ └── test_rsh.py │ └── utility.py │ ├── make_source.py │ ├── readthedocs.yml │ ├── scripts │ ├── make_release_sources.py │ ├── rsh_coef_gen.py │ └── time_compare.py │ ├── setup.cfg │ ├── setup.py │ └── versioneer.py ├── include └── gauxc │ ├── atom.hpp │ ├── basisset.hpp │ ├── basisset_map.hpp │ ├── enums.hpp │ ├── exceptions.hpp │ ├── external │ ├── cereal.hpp │ └── hdf5.hpp │ ├── gauxc_config.hpp.in │ ├── grid.hpp │ ├── grid_factory.hpp │ ├── load_balancer.hpp │ ├── molecular_weights.hpp │ ├── molecule.hpp │ ├── molgrid.hpp │ ├── molgrid │ └── defaults.hpp │ ├── molmeta.hpp │ ├── named_type.hpp │ ├── reduction_driver.hpp │ ├── runtime_environment.hpp │ ├── runtime_environment │ ├── decl.hpp │ └── fwd.hpp │ ├── shell.hpp │ ├── shell_pair.hpp │ ├── types.hpp │ ├── util │ ├── constexpr_math.hpp │ ├── contiguous_container_data.hpp │ ├── div_ceil.hpp │ ├── environment.hpp │ ├── gau_rad_eval.hpp │ ├── geometry.hpp │ ├── misc.hpp │ ├── mpi.hpp │ ├── real_solid_harmonics.hpp │ ├── timer.hpp │ └── unused.hpp │ ├── xc_integrator.hpp │ ├── xc_integrator │ ├── impl.hpp │ ├── integrator_factory.hpp │ ├── local_work_driver.hpp │ ├── replicated │ │ ├── impl.hpp │ │ ├── replicated_xc_device_integrator.hpp │ │ ├── replicated_xc_host_integrator.hpp │ │ ├── replicated_xc_integrator_factory.hpp │ │ └── replicated_xc_integrator_impl.hpp │ ├── replicated_xc_integrator.hpp │ └── xc_integrator_impl.hpp │ ├── xc_integrator_settings.hpp │ └── xc_task.hpp ├── src ├── CMakeLists.txt ├── atomic_radii.cxx ├── exceptions │ ├── cublas_exception.hpp │ ├── cuda_exception.hpp │ ├── cutlass_exception.hpp │ ├── hip_exception.hpp │ ├── hipblas_exception.hpp │ └── magma_exception.hpp ├── external │ ├── CMakeLists.txt │ ├── hdf5_read.cxx │ ├── hdf5_util.hpp │ └── hdf5_write.cxx ├── grid.cxx ├── grid_factory.cxx ├── grid_impl.cxx ├── grid_impl.hpp ├── load_balancer │ ├── CMakeLists.txt │ ├── device │ │ ├── CMakeLists.txt │ │ ├── cuda │ │ │ ├── CMakeLists.txt │ │ │ ├── cuda_collision_detection.cu │ │ │ ├── cuda_collision_detection.hpp │ │ │ ├── replicated_cuda_load_balancer.cxx │ │ │ └── replicated_cuda_load_balancer.hpp │ │ ├── hip │ │ │ ├── CMakeLists.txt │ │ │ ├── hip_collision_detection.hip │ │ │ ├── hip_collision_detection.hpp │ │ │ ├── replicated_hip_load_balancer.cxx │ │ │ └── replicated_hip_load_balancer.hpp │ │ ├── load_balancer_device_factory.cxx │ │ └── load_balancer_device_factory.hpp │ ├── host │ │ ├── fillin_replicated_load_balancer.cxx │ │ ├── fillin_replicated_load_balancer.hpp │ │ ├── load_balancer_host_factory.cxx │ │ ├── load_balancer_host_factory.hpp │ │ ├── petite_replicated_load_balancer.cxx │ │ ├── petite_replicated_load_balancer.hpp │ │ ├── replicated_host_load_balancer.cxx │ │ └── replicated_host_load_balancer.hpp │ ├── load_balancer.cxx │ ├── load_balancer_factory.cxx │ ├── load_balancer_impl.cxx │ ├── load_balancer_impl.hpp │ └── rebalance.cxx ├── molecular_weights │ ├── CMakeLists.txt │ ├── device │ │ ├── CMakeLists.txt │ │ ├── device_molecular_weights.cxx │ │ └── device_molecular_weights.hpp │ ├── host │ │ ├── CMakeLists.txt │ │ ├── host_molecular_weights.cxx │ │ └── host_molecular_weights.hpp │ ├── molecular_weights.cxx │ └── molecular_weights_impl.hpp ├── molgrid.cxx ├── molgrid_defaults.cxx ├── molgrid_impl.cxx ├── molgrid_impl.hpp ├── molmeta.cxx ├── reduction_driver │ ├── CMakeLists.txt │ ├── device │ │ ├── CMakeLists.txt │ │ ├── device_reduction_driver.cxx │ │ ├── device_reduction_driver.hpp │ │ ├── nccl_reduction_driver.cxx │ │ └── nccl_reduction_driver.hpp │ ├── host │ │ ├── CMakeLists.txt │ │ ├── basic_mpi_reduction_driver.cxx │ │ ├── basic_mpi_reduction_driver.hpp │ │ ├── host_reduction_driver.cxx │ │ └── host_reduction_driver.hpp │ ├── reduction_driver.cxx │ ├── reduction_driver_factory.cxx │ ├── reduction_driver_impl.cxx │ └── reduction_driver_impl.hpp ├── runtime_environment │ ├── CMakeLists.txt │ ├── device │ │ ├── CMakeLists.txt │ │ ├── cuda │ │ │ ├── CMakeLists.txt │ │ │ ├── cuda_backend.cxx │ │ │ └── cuda_backend.hpp │ │ ├── device_backend.hpp │ │ ├── device_blas_handle.hpp │ │ ├── device_queue.hpp │ │ ├── device_runtime_environment.cxx │ │ ├── device_runtime_environment_impl.hpp │ │ └── hip │ │ │ ├── CMakeLists.txt │ │ │ ├── hip_backend.cxx │ │ │ └── hip_backend.hpp │ ├── device_specific │ │ ├── cublas_util.hpp │ │ ├── cuda_device_constants.hpp │ │ ├── cuda_util.hpp │ │ ├── fast_exp.hpp │ │ ├── hip_device_constants.hpp │ │ ├── hip_util.hpp │ │ ├── hipblas_util.hpp │ │ ├── magma_util.hpp │ │ └── nccl_util.hpp │ ├── runtime_environment.cxx │ └── runtime_environment_impl.hpp └── xc_integrator │ ├── CMakeLists.txt │ ├── integrator_util │ ├── CMakeLists.txt │ ├── exx_screening.cxx │ ├── exx_screening.hpp │ ├── integral_bounds.cxx │ ├── integral_bounds.hpp │ ├── integrator_common.cxx │ └── integrator_common.hpp │ ├── local_work_driver │ ├── CMakeLists.txt │ ├── common │ │ └── integrator_constants.hpp │ ├── device │ │ ├── CMakeLists.txt │ │ ├── common │ │ │ ├── collocation_device.hpp │ │ │ ├── device_blas.hpp │ │ │ ├── exx_ek_screening.hpp │ │ │ ├── inc_potential.hpp │ │ │ ├── increment_exc_grad.hpp │ │ │ ├── pack_submat.hpp │ │ │ ├── shell_pair_to_task.hpp │ │ │ ├── shell_to_task.hpp │ │ │ ├── symmetrize_mat.hpp │ │ │ ├── uvvars.hpp │ │ │ ├── xc_functional_eval_wrapper.hpp │ │ │ └── zmat_vxc.hpp │ │ ├── cuda │ │ │ ├── CMakeLists.txt │ │ │ ├── cuda_aos_scheme1.cxx │ │ │ ├── cuda_aos_scheme1.hpp │ │ │ ├── cuda_aos_scheme1_data.cxx │ │ │ ├── cuda_aos_scheme1_weights.cu │ │ │ ├── cuda_aos_scheme1_weights.hpp │ │ │ ├── kernels │ │ │ │ ├── collocation │ │ │ │ │ ├── collocation_angular_cartesian.hpp │ │ │ │ │ ├── collocation_angular_spherical_unnorm.hpp │ │ │ │ │ ├── collocation_device_constants.hpp │ │ │ │ │ ├── collocation_radial.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l0.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l0_gradient.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l0_hessian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l0_laplacian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l1.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l1_gradient.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l1_hessian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l1_laplacian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l2.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l2_gradient.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l2_hessian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l2_laplacian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l3.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l3_gradient.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l3_hessian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l3_laplacian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l4.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l4_gradient.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l4_hessian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_cartesian_l4_laplacian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l0.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l0_gradient.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l0_hessian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l0_laplacian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l1.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l1_gradient.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l1_hessian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l1_laplacian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l2.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l2_gradient.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l2_hessian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l2_laplacian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l3.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l3_gradient.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l3_hessian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l3_laplacian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l4.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l4_gradient.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l4_hessian.hpp │ │ │ │ │ ├── collocation_shell_to_task_kernels_spherical_l4_laplacian.hpp │ │ │ │ │ ├── deprecated │ │ │ │ │ │ ├── gaueval_kernels_template.cu │ │ │ │ │ │ └── generate_bfeval.py │ │ │ │ │ ├── scripts │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ ├── collocation_angular.py │ │ │ │ │ │ ├── generate_collocation_angular_eval.py │ │ │ │ │ │ ├── generate_collocation_headers.py │ │ │ │ │ │ └── generate_shell_to_task.py │ │ │ │ │ └── templates │ │ │ │ │ │ ├── collocation_angular_template.hpp │ │ │ │ │ │ ├── collocation_device_constants_template.hpp │ │ │ │ │ │ ├── collocation_device_template.cu │ │ │ │ │ │ ├── collocation_shell_to_task_kernels.hpp │ │ │ │ │ │ ├── collocation_shell_to_task_kernels_template.hpp │ │ │ │ │ │ └── collocation_task_to_shell.hpp │ │ │ │ ├── collocation_device.cu │ │ │ │ ├── collocation_masked_combined_kernels.hpp │ │ │ │ ├── collocation_masked_kernels.hpp │ │ │ │ ├── collocation_shell_to_task_kernels.hpp │ │ │ │ ├── cublas_extensions.cu │ │ │ │ ├── cuda_extensions.hpp │ │ │ │ ├── cuda_inc_potential.cu │ │ │ │ ├── cuda_ssf_1d.cu │ │ │ │ ├── cuda_ssf_1d.hpp │ │ │ │ ├── cuda_ssf_2d.hu │ │ │ │ ├── cutlass_wrapper.cu │ │ │ │ ├── cutlass_wrapper.hpp │ │ │ │ ├── exx_ek_screening_bfn_stats.cu │ │ │ │ ├── grid_to_center.cu │ │ │ │ ├── grid_to_center.hpp │ │ │ │ ├── increment_exc_grad.cu │ │ │ │ ├── pack_submat.cu │ │ │ │ ├── symmetrize_mat.cu │ │ │ │ ├── uvvars.cu │ │ │ │ └── zmat_vxc.cu │ │ │ ├── obara_saika │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── Makefile │ │ │ │ ├── generator │ │ │ │ │ ├── Makefile │ │ │ │ │ └── generate_gpu_code.c │ │ │ │ ├── include │ │ │ │ │ └── gpu │ │ │ │ │ │ ├── chebyshev_boys_computation.hpp │ │ │ │ │ │ ├── integral_data_types.hpp │ │ │ │ │ │ └── obara_saika_integrals.hpp │ │ │ │ ├── src │ │ │ │ │ ├── chebyshev_boys_computation.cu │ │ │ │ │ ├── config_obara_saika.hpp │ │ │ │ │ ├── integral_0.cu │ │ │ │ │ ├── integral_0.hu │ │ │ │ │ ├── integral_0_0.cu │ │ │ │ │ ├── integral_0_0.hu │ │ │ │ │ ├── integral_1.cu │ │ │ │ │ ├── integral_1.hu │ │ │ │ │ ├── integral_1_0.cu │ │ │ │ │ ├── integral_1_0.hu │ │ │ │ │ ├── integral_1_1.cu │ │ │ │ │ ├── integral_1_1.hu │ │ │ │ │ ├── integral_2.cu │ │ │ │ │ ├── integral_2.hu │ │ │ │ │ ├── integral_2_0.cu │ │ │ │ │ ├── integral_2_0.hu │ │ │ │ │ ├── integral_2_1.cu │ │ │ │ │ ├── integral_2_1.hu │ │ │ │ │ ├── integral_2_2.cu │ │ │ │ │ ├── integral_2_2.hu │ │ │ │ │ ├── obara_saika_integrals.cu │ │ │ │ │ └── task_map_base.hu │ │ │ │ └── test │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── test.cpp │ │ │ │ │ └── test_new.cpp │ │ │ ├── scheme1_cutlass_base.cxx │ │ │ ├── scheme1_cutlass_base.hpp │ │ │ ├── scheme1_cutlass_data_base.cxx │ │ │ └── xc_functional_eval_wrapper.cxx │ │ ├── hip │ │ │ ├── CMakeLists.txt │ │ │ ├── hip_aos_scheme1.cxx │ │ │ ├── hip_aos_scheme1.hpp │ │ │ ├── hip_aos_scheme1_data.cxx │ │ │ ├── hipify.sh │ │ │ ├── kernels │ │ │ │ ├── collocation │ │ │ │ │ ├── collocation_angular_cartesian.hpp │ │ │ │ │ ├── collocation_angular_spherical_unnorm.hpp │ │ │ │ │ ├── collocation_device_constants.hpp │ │ │ │ │ └── collocation_spherical_unnorm.hpp │ │ │ │ ├── collocation_device.hip │ │ │ │ ├── collocation_masked_combined_kernels.hpp │ │ │ │ ├── collocation_masked_kernels.hpp │ │ │ │ ├── grid_to_center.hip │ │ │ │ ├── grid_to_center.hpp │ │ │ │ ├── hip_extensions.hpp │ │ │ │ ├── hip_inc_potential.hip │ │ │ │ ├── hip_ssf_1d.hip │ │ │ │ ├── hip_ssf_1d.hpp │ │ │ │ ├── hip_ssh_2d.hip │ │ │ │ ├── hip_ssh_2d.hpp │ │ │ │ ├── hipblas_extensions.hip │ │ │ │ ├── pack_submat.hip │ │ │ │ ├── symmetrize_mat.hip │ │ │ │ ├── uvvars.hip │ │ │ │ └── zmat_vxc.hip │ │ │ └── xc_functional_eval_wrapper.cxx │ │ ├── local_device_work_driver.cxx │ │ ├── local_device_work_driver.hpp │ │ ├── local_device_work_driver_pimpl.cxx │ │ ├── local_device_work_driver_pimpl.hpp │ │ ├── scheme1_base.cxx │ │ ├── scheme1_base.hpp │ │ ├── scheme1_data_base.cxx │ │ ├── scheme1_data_base.hpp │ │ ├── scheme1_magma_base.cxx │ │ ├── scheme1_magma_base.hpp │ │ └── scheme1_magma_data_base.cxx │ ├── factory.cxx │ └── host │ │ ├── CMakeLists.txt │ │ ├── blas.cxx │ │ ├── blas.hpp │ │ ├── local_host_work_driver.cxx │ │ ├── local_host_work_driver.hpp │ │ ├── local_host_work_driver_pimpl.cxx │ │ ├── local_host_work_driver_pimpl.hpp │ │ ├── obara_saika │ │ ├── CMakeLists.txt │ │ ├── Makefile │ │ ├── generator │ │ │ ├── Makefile │ │ │ ├── generate_cpu_code.c │ │ │ └── generate_cpu_code.c.bk │ │ ├── include │ │ │ └── cpu │ │ │ │ ├── chebyshev_boys_computation.hpp │ │ │ │ ├── integral_data_types.hpp │ │ │ │ └── obara_saika_integrals.hpp │ │ ├── src │ │ │ ├── chebyshev_boys_computation.cxx │ │ │ ├── config_obara_saika.hpp │ │ │ ├── integral_0.cxx │ │ │ ├── integral_0.hpp │ │ │ ├── integral_0_0.cxx │ │ │ ├── integral_0_0.hpp │ │ │ ├── integral_1.cxx │ │ │ ├── integral_1.hpp │ │ │ ├── integral_1_0.cxx │ │ │ ├── integral_1_0.hpp │ │ │ ├── integral_1_1.cxx │ │ │ ├── integral_1_1.hpp │ │ │ ├── integral_2.cxx │ │ │ ├── integral_2.hpp │ │ │ ├── integral_2_0.cxx │ │ │ ├── integral_2_0.hpp │ │ │ ├── integral_2_1.cxx │ │ │ ├── integral_2_1.hpp │ │ │ ├── integral_2_2.cxx │ │ │ ├── integral_2_2.hpp │ │ │ ├── integral_3.cxx │ │ │ ├── integral_3.hpp │ │ │ ├── integral_3_0.cxx │ │ │ ├── integral_3_0.hpp │ │ │ ├── integral_3_1.cxx │ │ │ ├── integral_3_1.hpp │ │ │ ├── integral_3_2.cxx │ │ │ ├── integral_3_2.hpp │ │ │ ├── integral_3_3.cxx │ │ │ ├── integral_3_3.hpp │ │ │ ├── integral_4.cxx │ │ │ ├── integral_4.hpp │ │ │ ├── integral_4_0.cxx │ │ │ ├── integral_4_0.hpp │ │ │ ├── integral_4_1.cxx │ │ │ ├── integral_4_1.hpp │ │ │ ├── integral_4_2.cxx │ │ │ ├── integral_4_2.hpp │ │ │ ├── integral_4_3.cxx │ │ │ ├── integral_4_3.hpp │ │ │ ├── integral_4_4.cxx │ │ │ ├── integral_4_4.hpp │ │ │ └── obara_saika_integrals.cxx │ │ └── test │ │ │ ├── Makefile │ │ │ ├── archive │ │ │ ├── test.cxx │ │ │ ├── test1.cxx │ │ │ ├── test2.cxx │ │ │ ├── test3.cxx │ │ │ ├── test_boys.cxx │ │ │ ├── test_boys_v0.cxx │ │ │ ├── test_boys_v1.cxx │ │ │ ├── test_boys_v2.cxx │ │ │ ├── test_boys_v3.cxx │ │ │ └── test_boys_v4.cxx │ │ │ └── test_experimental.cxx │ │ ├── reference │ │ ├── collocation.hpp │ │ ├── gau2grid_collocation.cxx │ │ ├── weights.cxx │ │ └── weights.hpp │ │ ├── reference_local_host_work_driver.cxx │ │ ├── reference_local_host_work_driver.hpp │ │ ├── rys │ │ ├── CMakeLists.txt │ │ ├── Makefile │ │ ├── cheby_boys.cxx │ │ ├── include │ │ │ └── rys_integral.h │ │ ├── scripts │ │ │ ├── generate_rys_kernel.py │ │ │ └── rys_kernel_template.hpp │ │ ├── src │ │ │ ├── boys.h │ │ │ ├── boys_table.c │ │ │ ├── jacobi.h │ │ │ ├── jacobi_table.c │ │ │ ├── rys_1rw.c │ │ │ ├── rys_1rw.h │ │ │ ├── rys_2rw.c │ │ │ ├── rys_2rw.h │ │ │ ├── rys_3rw.c │ │ │ ├── rys_3rw.h │ │ │ ├── rys_4rw.c │ │ │ ├── rys_4rw.h │ │ │ ├── rys_5rw.c │ │ │ ├── rys_5rw.h │ │ │ ├── rys_integral.c │ │ │ ├── rys_integral.c.bk │ │ │ ├── rys_rw.c │ │ │ ├── rys_rw.h │ │ │ ├── rys_xrw.c │ │ │ └── rys_xrw.h │ │ └── test │ │ │ ├── test_int_v0.c │ │ │ ├── test_points.txt │ │ │ └── test_shells.txt │ │ └── util.hpp │ ├── replicated │ ├── CMakeLists.txt │ ├── device │ │ ├── CMakeLists.txt │ │ ├── incore_replicated_xc_device_integrator.cxx │ │ ├── incore_replicated_xc_device_integrator.hpp │ │ ├── incore_replicated_xc_device_integrator_exc.hpp │ │ ├── incore_replicated_xc_device_integrator_exc_grad.hpp │ │ ├── incore_replicated_xc_device_integrator_exc_vxc.hpp │ │ ├── incore_replicated_xc_device_integrator_exx.hpp │ │ ├── incore_replicated_xc_device_integrator_integrate_den.hpp │ │ ├── replicated_xc_device_integrator.cxx │ │ ├── shell_batched_replicated_xc_device_integrator.cxx │ │ └── shell_batched_replicated_xc_device_integrator.hpp │ ├── host │ │ ├── CMakeLists.txt │ │ ├── reference_replicated_xc_host_integrator.cxx │ │ ├── reference_replicated_xc_host_integrator.hpp │ │ ├── reference_replicated_xc_host_integrator_exc.hpp │ │ ├── reference_replicated_xc_host_integrator_exc_grad.hpp │ │ ├── reference_replicated_xc_host_integrator_exc_vxc.hpp │ │ ├── reference_replicated_xc_host_integrator_exx.hpp │ │ ├── reference_replicated_xc_host_integrator_integrate_den.hpp │ │ ├── replicated_xc_host_integrator.cxx │ │ ├── shell_batched_replicated_xc_host_integrator.cxx │ │ ├── shell_batched_replicated_xc_host_integrator.hpp │ │ └── xc_host_data.hpp │ └── replicated_xc_integrator_impl.cxx │ ├── shell_batched │ ├── CMakeLists.txt │ ├── shell_batched_replicated_xc_integrator.hpp │ ├── shell_batched_replicated_xc_integrator_exc.hpp │ ├── shell_batched_replicated_xc_integrator_exc_grad.hpp │ ├── shell_batched_replicated_xc_integrator_exc_vxc.hpp │ ├── shell_batched_replicated_xc_integrator_exx.hpp │ ├── shell_batched_replicated_xc_integrator_integrate_den.hpp │ ├── shell_batched_xc_integrator.cxx │ └── shell_batched_xc_integrator.hpp │ └── xc_data │ ├── CMakeLists.txt │ ├── buffer_adaptor.hpp │ └── device │ ├── CMakeLists.txt │ ├── xc_device_aos_data.cxx │ ├── xc_device_aos_data.hpp │ ├── xc_device_data.hpp │ ├── xc_device_shell_pair_soa.hpp │ ├── xc_device_stack_data.cxx │ ├── xc_device_stack_data.hpp │ └── xc_device_task.hpp └── tests ├── CMakeLists.txt ├── basis ├── new │ ├── 6-31g*.g94 │ └── cc-pvdz.g94 ├── old │ ├── 6-31g*.g94 │ └── cc-pvdz.g94 ├── parse_basis.cxx └── parse_basis.hpp ├── basisset_test.cxx ├── cmake ├── discovery │ ├── CMakeLists.txt │ └── gauxc_link_tester.cxx └── subproject │ ├── CMakeLists.txt │ └── gauxc_link_tester.cxx ├── collocation.cxx ├── collocation_common.hpp ├── collocation_cuda.hpp ├── collocation_hip.hpp ├── collocation_host.hpp ├── conv_cereal_to_hdf5.cxx ├── eigen3_matrix_serialization.hpp ├── environment.cxx ├── grid_opt.cxx ├── grid_test.cxx ├── ini_input.cxx ├── ini_input.hpp ├── load_balancer_test.cxx ├── molgrid_test.cxx ├── moltypes_test.cxx ├── ref_data ├── benzene_631gd_pbe0_ufg.hdf5 ├── benzene_cc-pvdz_ufg_tasks_1mpi_rank0_pv1.bin ├── benzene_cc-pvdz_ufg_tasks_1mpi_rank0_pv32.bin ├── benzene_cc-pvdz_ufg_tasks_2mpi_rank0_pv1.bin ├── benzene_cc-pvdz_ufg_tasks_2mpi_rank0_pv32.bin ├── benzene_cc-pvdz_ufg_tasks_2mpi_rank1_pv1.bin ├── benzene_cc-pvdz_ufg_tasks_2mpi_rank1_pv32.bin ├── benzene_pbe0_cc-pvdz_ufg_ssf.hdf5 ├── benzene_svwn5_cc-pvdz_ufg_ssf.hdf5 ├── benzene_svwn5_cc-pvdz_ufg_ssf_robust_prune.hdf5 ├── benzene_svwn5_cc-pvdz_ufg_ssf_treutler_prune.hdf5 ├── benzene_weights_becke.bin ├── benzene_weights_lko.bin ├── benzene_weights_ssf.bin ├── cytosine_r2scanl_cc-pvdz_ufg_ssf_robust.hdf5 ├── cytosine_r2scanl_cc-pvdz_ufg_ssf_robust_uks.hdf5 ├── cytosine_scan_cc-pvdz_ufg_ssf_robust.hdf5 ├── cytosine_scan_cc-pvdz_ufg_ssf_robust_uks.hdf5 ├── h2o2_def2-qzvp.hdf5 ├── h2o2_def2-tzvp.hdf5 ├── h3_blyp_cc-pvdz_ssf_gks.bin ├── li_blyp_sto3g_uks.bin ├── li_svwn5_sto3g_uks.bin ├── ut_input.inp └── water_cc-pVDZ_collocation.bin ├── runtime.cxx ├── standalone_driver.cxx ├── standards.cxx ├── standards.hpp ├── ut_common.hpp.in ├── ut_main.cxx ├── weights.cxx ├── weights_cuda.hpp ├── weights_generate.hpp ├── weights_hip.hpp ├── weights_host.hpp └── xc_integrator.cxx /.github/workflows/scripts/compiler_setup.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | export CSUITE=$1 4 | export CVER=$2 5 | 6 | if [[ "${CSUITE}" == "llvm" ]] 7 | then 8 | update-alternatives --set clang /usr/bin/clang-${CVER} 9 | update-alternatives --set clang++ /usr/bin/clang++-${CVER} 10 | update-alternatives --install /usr/bin/cc cc /usr/bin/clang 30 11 | update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 30 12 | elif [[ "${CSUITE}" == "gnu" ]] 13 | then 14 | update-alternatives --set gcc /usr/bin/gcc-${CVER} 15 | update-alternatives --set g++ /usr/bin/g++-${CVER} 16 | update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 17 | update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 18 | else 19 | echo "Compiler Suite Not Recognized!" 20 | exit 125 21 | fi 22 | 23 | -------------------------------------------------------------------------------- /.github/workflows/toolchains/gh-actions.cmake: -------------------------------------------------------------------------------- 1 | set( CMAKE_C_COMPILER cc ) 2 | set( CMAKE_CXX_COMPILER c++ ) 3 | 4 | set(CMAKE_CXX_FLAGS_INIT "-march=native") 5 | set(CMAKE_C_FLAGS_INIT "-march=native") 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *pycache** 2 | src/xc_integrator/local_work_driver/host/obara_saika/src/*.o 3 | src/xc_integrator/local_work_driver/host/obara_saika/*.a 4 | src/xc_integrator/local_work_driver/host/obara_saika/test/*.o 5 | src/xc_integrator/local_work_driver/host/obara_saika/test/*.x 6 | src/xc_integrator/local_work_driver/host/obara_saika/generator/integral* 7 | src/xc_integrator/local_work_driver/host/obara_saika/generator/obara* 8 | src/xc_integrator/local_work_driver/host/obara_saika/generator/*.x 9 | -------------------------------------------------------------------------------- /attic/include/gauxc/new_xc_integrator/impl.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace GauXC { 6 | 7 | template 8 | XCIntegrator::XCIntegrator( std::unique_ptr&& pimpl ) : 9 | pimpl_( std::move( pimpl ) ) { } 10 | 11 | 12 | template 13 | XCIntegrator::~XCIntegrator() noexcept = default; 14 | 15 | template 16 | XCIntegrator::XCIntegrator(XCIntegrator&&) noexcept = default; 17 | 18 | 19 | template 20 | typename XCIntegrator::exc_vxc_type 21 | XCIntegrator::eval_exc_vxc( const MatrixType& P ) { 22 | if( not pimpl_ ) throw std::runtime_error("Not Initialized"); 23 | return pimpl_->eval_exc_vxc(P); 24 | }; 25 | 26 | template 27 | const util::Timer& XCIntegrator::get_timings() const { 28 | if( not pimpl_ ) throw std::runtime_error("Not Initialized"); 29 | 30 | return pimpl_->get_timings(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /attic/include/gauxc/new_xc_integrator/replicated_xc_integrator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace GauXC { 6 | namespace detail { 7 | 8 | template 9 | class ReplicatedXCIntegratorImpl; 10 | 11 | template 12 | class ReplicatedXCIntegrator : public XCIntegratorImpl { 13 | 14 | public: 15 | 16 | using matrix_type = typename XCIntegratorImpl::matrix_type; 17 | using value_type = typename XCIntegratorImpl::value_type; 18 | using exc_vxc_type = typename XCIntegratorImpl::exc_vxc_type; 19 | 20 | private: 21 | 22 | using pimpl_type = ReplicatedXCIntegratorImpl; 23 | std::unique_ptr< pimpl_type > pimpl_; 24 | 25 | exc_vxc_type eval_exc_vxc_( const MatrixType& ) override; 26 | const util::Timer& get_timings_() const override; 27 | 28 | public: 29 | 30 | ReplicatedXCIntegrator(); 31 | ReplicatedXCIntegrator( std::unique_ptr&& ); 32 | 33 | ~ReplicatedXCIntegrator() noexcept; 34 | 35 | ReplicatedXCIntegrator( const ReplicatedXCIntegrator& ) = delete; 36 | ReplicatedXCIntegrator( ReplicatedXCIntegrator&& ) noexcept; 37 | 38 | }; 39 | 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /attic/include/gauxc/new_xc_integrator/xc_integrator_impl.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace GauXC { 6 | namespace detail { 7 | 8 | template 9 | class XCIntegratorImpl { 10 | 11 | public: 12 | 13 | using matrix_type = MatrixType; 14 | using value_type = typename matrix_type::value_type; 15 | using exc_vxc_type = typename XCIntegrator::exc_vxc_type; 16 | 17 | protected: 18 | 19 | virtual exc_vxc_type eval_exc_vxc_( const MatrixType& ) = 0; 20 | virtual const util::Timer& get_timings_() const = 0; 21 | 22 | public: 23 | 24 | XCIntegratorImpl() = default; 25 | XCIntegratorImpl( const XCIntegratorImpl& ) = default; 26 | XCIntegratorImpl( XCIntegratorImpl&& ) noexcept = default; 27 | virtual ~XCIntegratorImpl() noexcept = default; 28 | 29 | 30 | exc_vxc_type eval_exc_vxc( const MatrixType& P ) { 31 | return eval_exc_vxc_(P); 32 | } 33 | 34 | const util::Timer& get_timings() const { 35 | return get_timings_(); 36 | } 37 | 38 | }; 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /attic/include/gauxc/new_xc_integrator/xc_integrator_state.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | 5 | struct XCIntegratorState { 6 | bool load_balancer_populated = false; 7 | bool modified_weights_are_stored = false; 8 | }; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /attic/include/gauxc/util/forward_as_shared_ptr.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace GauXC { 6 | namespace detail { 7 | 8 | template 9 | std::shared_ptr> forward_as_shared_ptr( const T& t ) { 10 | return std::make_shared>( t ); 11 | } 12 | 13 | //template 14 | //std::shared_ptr> forward_as_shared_ptr( T& t ) { 15 | // std::cout << "Resolving Ref Copy Forward" << std::endl; 16 | // return std::make_shared>( t ); 17 | //} 18 | // 19 | //template 20 | //std::shared_ptr> forward_as_shared_ptr( T&& t ) { 21 | // std::cout << "Resolving Move Forward" << std::endl; 22 | // return std::make_shared>( std::move(t) ); 23 | //} 24 | 25 | template 26 | std::shared_ptr forward_as_shared_ptr( std::shared_ptr ptr ) { 27 | return ptr; 28 | } 29 | 30 | // Disable forward for MPI_Comm 31 | #ifdef GAUXC_ENABLE_MPI 32 | MPI_Comm forward_as_shared_ptr( MPI_Comm comm ) { 33 | return comm; 34 | } 35 | #endif 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /attic/include/gauxc/xc_integrator/impl.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace GauXC { 6 | 7 | template 8 | XCIntegrator::XCIntegrator( std::unique_ptr&& pimpl ) : 9 | pimpl_( std::move( pimpl ) ) { } 10 | 11 | 12 | template 13 | XCIntegrator::~XCIntegrator() noexcept = default; 14 | 15 | template 16 | XCIntegrator::XCIntegrator(XCIntegrator&&) noexcept = default; 17 | 18 | 19 | template 20 | typename XCIntegrator::exc_vxc_type 21 | XCIntegrator::eval_exc_vxc( const MatrixType& P ) { 22 | if( not pimpl_ ) throw std::runtime_error("Not Initialized"); 23 | 24 | return pimpl_->eval_exc_vxc(P); 25 | }; 26 | 27 | template 28 | const util::Timer& XCIntegrator::get_timings() const { 29 | if( not pimpl_ ) throw std::runtime_error("Not Initialized"); 30 | 31 | return pimpl_->get_timings(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /attic/include/gauxc/xc_integrator/xc_host_data.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #ifdef GAUXC_ENABLE_HOST 9 | namespace GauXC { 10 | 11 | template 12 | struct XCHostData { 13 | 14 | std::vector eps; 15 | std::vector gamma; 16 | std::vector vrho; 17 | std::vector vgamma; 18 | 19 | std::vector zmat; 20 | std::vector nbe_scr; 21 | std::vector den_scr; 22 | std::vector basis_eval; 23 | 24 | 25 | XCHostData( size_t n_deriv, 26 | size_t nbf, 27 | size_t max_npts, 28 | size_t max_npts_x_nbe ) : 29 | eps( max_npts ), 30 | gamma( (n_deriv > 0) * max_npts ), 31 | vrho( max_npts ), 32 | vgamma( (n_deriv > 0) * max_npts ), 33 | zmat( max_npts_x_nbe ), 34 | nbe_scr( nbf * nbf ), 35 | den_scr( (3*n_deriv + 1) * max_npts ), 36 | basis_eval( (3*n_deriv + 1) * max_npts_x_nbe ) { } 37 | 38 | 39 | }; 40 | 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /attic/include/gauxc/xc_integrator/xc_host_util.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include 5 | #include "xc_integrator_state.hpp" 6 | 7 | #ifdef GAUXC_ENABLE_HOST 8 | namespace GauXC { 9 | namespace integrator { 10 | namespace host { 11 | 12 | 13 | template 14 | void process_batches_host_replicated_p( 15 | XCIntegratorState integrator_state, 16 | XCWeightAlg weight_alg, 17 | const functional_type& func, 18 | const BasisSet& basis, 19 | const Molecule & mol, 20 | const MolMeta & meta, 21 | XCHostData & host_data, 22 | std::vector< XCTask >& local_work, 23 | const F* P, 24 | F* VXC, 25 | F* exc, 26 | F* n_el 27 | ); 28 | 29 | 30 | template 31 | inline void process_batches_host_replicated_p( size_t n_deriv, Args&&... args ) { 32 | if( n_deriv == 0 ) 33 | process_batches_host_replicated_p( std::forward(args)... ); 34 | else if( n_deriv == 1 ) 35 | process_batches_host_replicated_p( std::forward(args)... ); 36 | else 37 | throw std::runtime_error("MGGA NYI"); 38 | } 39 | 40 | } 41 | } 42 | } 43 | #endif 44 | -------------------------------------------------------------------------------- /attic/include/gauxc/xc_integrator/xc_integrator_state.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | 5 | struct XCIntegratorState { 6 | bool load_balancer_populated = false; 7 | bool modified_weights_are_stored = false; 8 | }; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /attic/src/integrator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Integrator Utilities 2 | target_sources( gauxc PRIVATE integrator_common.cxx ) 3 | target_include_directories( gauxc 4 | PUBLIC 5 | $ 6 | ) 7 | 8 | # Host Integrator Utilities 9 | if( GAUXC_ENABLE_HOST ) 10 | include( host/gauxc-host_integrator.cmake ) 11 | endif() 12 | 13 | if( GAUXC_ENABLE_CUDA ) 14 | include( cuda/gauxc-cuda_integrator.cmake ) 15 | endif() 16 | -------------------------------------------------------------------------------- /attic/src/integrator/cuda/buffer_adaptor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | 5 | class buffer_adaptor { 6 | 7 | size_t nalloc_; 8 | size_t nleft_; 9 | void* top_; 10 | void* stack_; 11 | 12 | public: 13 | 14 | buffer_adaptor() = delete; 15 | 16 | inline buffer_adaptor( void* ptr, size_t len ) : 17 | nalloc_(len), 18 | nleft_(len), 19 | top_(ptr), 20 | stack_(ptr) { } 21 | 22 | template 23 | T* aligned_alloc( size_t len, 24 | size_t align = alignof(T) ) { 25 | 26 | char* old_stack = (char*)stack_; 27 | if( std::align( align, 28 | len*sizeof(T), 29 | stack_, 30 | nleft_ ) ) { 31 | 32 | T* result = reinterpret_cast(stack_); 33 | stack_ = (char*)stack_ + len*sizeof(T); 34 | nleft_ -= std::distance( old_stack, 35 | (char*)stack_ ); 36 | return result; 37 | 38 | } 39 | 40 | throw std::bad_alloc(); 41 | 42 | } 43 | 44 | inline void* stack() const {return stack_;} 45 | inline size_t nleft() const { return nleft_; } 46 | 47 | }; 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /attic/src/integrator/cuda/collocation/collocation_device_constants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | namespace integrator { 5 | namespace cuda { 6 | 7 | constexpr double sqrt_15 = 3.872983346207417; 8 | constexpr double sqrt_3 = 1.7320508075688772; 9 | constexpr double sqrt_6 = 2.449489742783178; 10 | constexpr double sqrt_10 = 3.1622776601683795; 11 | 12 | } // namespace cuda 13 | } // namespace integrator 14 | } // namespace GauXC 15 | -------------------------------------------------------------------------------- /attic/src/integrator/cuda/collocation/scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/attic/src/integrator/cuda/collocation/scripts/__init__.py -------------------------------------------------------------------------------- /attic/src/integrator/cuda/collocation/templates/collocation_device_constants_template.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | namespace integrator { 5 | namespace cuda { 6 | 7 | $for( x in const_lines )\ 8 | $(x) 9 | $endfor\ 10 | 11 | } // namespace cuda 12 | } // namespace integrator 13 | } // namespace GauXC 14 | -------------------------------------------------------------------------------- /attic/src/integrator/cuda/cuda_alg_variant_control.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#define GAUXC_CUDA_ENABLE_COLLOCATION_SHMEM_COPY 4 | //#define GAUXC_CUDA_ENABLE_COMPACT_COLLOCATION 5 | -------------------------------------------------------------------------------- /attic/src/integrator/cuda/cuda_device_properties.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "cuda_runtime.h" 5 | 6 | #include "cuda/cuda_device_properties.hpp" 7 | 8 | namespace GauXC { 9 | namespace cuda { 10 | 11 | 12 | uint32_t get_submat_cut_block(int32_t LDA, int32_t device) { 13 | int l2_cache_size; 14 | cudaDeviceGetAttribute(&l2_cache_size, cudaDevAttrL2CacheSize, device); 15 | 16 | int l2_block_size = (int) sqrt(0.75 * ((double) l2_cache_size / 8)); 17 | int min_block_size = LDA / max_submat_blocks; 18 | 19 | int block_size = std::max(l2_block_size, min_block_size); 20 | block_size = std::min(block_size, LDA); 21 | 22 | return block_size; 23 | } 24 | 25 | uint32_t get_device_sm_count(int32_t device) { 26 | int num_sm; 27 | cudaDeviceGetAttribute(&num_sm, cudaDevAttrMultiProcessorCount, device); 28 | 29 | return num_sm; 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /attic/src/integrator/cuda/cuda_device_properties.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace cuda { 6 | 7 | static constexpr uint32_t warp_size = 32; 8 | static constexpr uint32_t max_threads_per_thread_block = 1024; 9 | static constexpr uint32_t max_warps_per_thread_block = 10 | max_threads_per_thread_block / warp_size; 11 | 12 | static constexpr uint32_t max_submat_blocks = 10; 13 | 14 | // Properties for weight algorithm 15 | static constexpr uint32_t weight_unroll = 4; 16 | static_assert(weight_unroll == 4, "Weight unroll is only tested for value of 4"); 17 | static constexpr uint32_t weight_thread_block = 640; 18 | static constexpr uint32_t weight_thread_block_per_sm = 2; 19 | 20 | uint32_t get_submat_cut_block(int32_t LDA, int32_t device); 21 | uint32_t get_device_sm_count(int32_t device); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /attic/src/integrator/cuda/cuda_inc_potential.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator { 6 | namespace cuda { 7 | 8 | using namespace GauXC::cuda; 9 | 10 | template 11 | void task_inc_potential( size_t ntasks, 12 | XCTaskDevice* device_tasks, 13 | T* V_device, 14 | size_t LDV, 15 | cudaStream_t stream ); 16 | 17 | template 18 | void symmetrize_matrix( size_t nbf, 19 | size_t LDV, 20 | T* V_device, 21 | cudaStream_t stream); 22 | 23 | } 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /attic/src/integrator/cuda/cuda_pack_density.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator { 6 | namespace cuda { 7 | 8 | using namespace GauXC::cuda; 9 | 10 | template 11 | void task_pack_density_matrix( size_t ntasks, 12 | XCTaskDevice* device_tasks, 13 | T* P_device, 14 | size_t LDP, 15 | cudaStream_t stream ); 16 | 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /attic/src/integrator/cuda/cuda_weights.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace GauXC { 7 | namespace integrator { 8 | namespace cuda { 9 | 10 | 11 | void cuda_reciprocal(size_t length, double* vec, cudaStream_t stream); 12 | 13 | template 14 | void partition_weights_cuda_SoA( XCWeightAlg weight_alg, 15 | size_t npts, 16 | size_t LDatoms, 17 | size_t natoms, 18 | const F* points_device, 19 | const int32_t* iparent_device, 20 | const F* dist_nearest_device, 21 | const F* rab_device, 22 | const F* atomic_coords_device, 23 | F* weights_device, 24 | F* dist_scratch_device, 25 | cudaStream_t stream ); 26 | 27 | 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /attic/src/integrator/cuda/cuda_zmat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator { 6 | namespace cuda { 7 | 8 | using namespace GauXC::cuda; 9 | 10 | template 11 | void zmat_lda_cuda( size_t ntasks, 12 | int32_t max_nbf, 13 | int32_t max_npts, 14 | XCTaskDevice* tasks_device, 15 | cudaStream_t stream ); 16 | 17 | template 18 | void zmat_gga_cuda( size_t ntasks, 19 | int32_t max_nbf, 20 | int32_t max_npts, 21 | XCTaskDevice* tasks_device, 22 | cudaStream_t stream ); 23 | 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /attic/src/integrator/host/blas.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC::blas { 5 | 6 | template 7 | void lacpy( char UPLO, int M, int N, const T* A, int LDA, T* B, 8 | int LDB ); 9 | 10 | template 11 | void gemm( char TA, char TB, int M, int N, int K, T ALPHA, 12 | const T* A, int LDA, const T* B, int LDB, T BETA, 13 | T* C, int LDC ); 14 | 15 | template 16 | void syr2k( char UPLO, char TRANS, int N, int K, T ALPHA, 17 | const T* A, int LDA, const T* B, int LDB, T BETA, 18 | T* C, int LDC ); 19 | 20 | 21 | template 22 | T dot( int N, const T* X, int INCX, const T* Y, int INCY ); 23 | 24 | template 25 | void axpy( int N, T ALPHA, const T* X, int INCX, T* Y, int INCY ); 26 | 27 | template 28 | void scal( int N, T ALPHA, T* X, int INCX ); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /attic/src/integrator/host/gauxc-host_integrator.cmake: -------------------------------------------------------------------------------- 1 | find_package( LAPACK REQUIRED ) 2 | include( gauxc-gau2grid ) 3 | target_sources( gauxc PRIVATE host/xc_host_util.cxx 4 | host/host_weights.cxx 5 | host/host_collocation.cxx 6 | host/host_zmat.cxx 7 | host/blas.cxx 8 | ) 9 | 10 | target_link_libraries( gauxc PUBLIC LAPACK::LAPACK ) 11 | 12 | if( GAUXC_ENABLE_GAU2GRID ) 13 | target_link_libraries( gauxc PUBLIC gau2grid::gg ) 14 | endif() 15 | 16 | -------------------------------------------------------------------------------- /attic/src/integrator/host/host_collocation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace GauXC::integrator::host { 6 | 7 | void eval_collocation( size_t npts, 8 | size_t nshells, 9 | size_t nbe, 10 | const double* points, 11 | const BasisSet& basis, 12 | const int32_t* shell_mask, 13 | double* basis_eval ); 14 | 15 | void eval_collocation_deriv1( size_t npts, 16 | size_t nshells, 17 | size_t nbe, 18 | const double* points, 19 | const BasisSet& basis, 20 | const int32_t* shell_mask, 21 | double* basis_eval, 22 | double* dbasis_x_eval, 23 | double* dbasis_y_eval, 24 | double* dbasis_z_eval ); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /attic/src/integrator/host/host_weights.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace GauXC::integrator::host { 6 | 7 | void partition_weights_host( 8 | XCWeightAlg weight_alg, 9 | const Molecule& mol, 10 | const MolMeta& meta, 11 | std::vector< XCTask >& tasks 12 | ); 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /attic/src/integrator/host/host_zmat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator::host { 6 | 7 | template 8 | void zmat_lda_host( int32_t npts, 9 | int32_t nbf, 10 | const F* vrho, 11 | const F* basis, 12 | F* z_matrix ); 13 | 14 | template 15 | void zmat_gga_host( int32_t npts, 16 | int32_t nbf, 17 | const F* vrho, 18 | const F* vgamma, 19 | const F* basis, 20 | const F* dbasis_x, 21 | const F* dbasis_y, 22 | const F* dbasis_z, 23 | const F* dden_x, 24 | const F* dden_y, 25 | const F* dden_z, 26 | F* z_matrix ); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /attic/src/integrator/integrator_common.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "integrator_constants.hpp" 4 | #include 5 | 6 | namespace GauXC { 7 | namespace integrator { 8 | 9 | std::tuple< std::vector< std::array > , std::vector< int32_t > > 10 | gen_compressed_submat_map( const BasisSet& basis_set, 11 | const std::vector< int32_t >& shell_mask, 12 | const int32_t LDA, const int32_t block_size ); 13 | 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /attic/src/integrator/integrator_constants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | namespace integrator { 5 | 6 | template 7 | constexpr F magic_ssf_factor = 0.64; 8 | 9 | constexpr double ssf_weight_tol = 1e-10; 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /attic/src/load_balancer_defaults.hpp: -------------------------------------------------------------------------------- 1 | #include "load_balancer/host/replicated_load_balancer.hpp" 2 | #include "load_balancer/cuda/replicated_load_balancer.hpp" 3 | 4 | namespace GauXC { 5 | namespace detail { 6 | 7 | template 8 | std::unique_ptr make_default_load_balancer(Args&&... args) { 9 | //#ifdef GAUXC_ENABLE_CUDA 10 | // return std::make_unique( std::forward(args)... ); 11 | //#else 12 | return std::make_unique( std::forward(args)... ); 13 | //#endif 14 | } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /attic/src/new_integrator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Implementations of generic interfaces 2 | target_sources( gauxc PRIVATE replicated_xc_integrator_impl.cxx ) 3 | 4 | target_include_directories( gauxc 5 | PUBLIC 6 | $ 7 | ) 8 | 9 | # Common Utilities 10 | include( common/gauxc-common.cmake ) 11 | 12 | # Host Integrator Utilities 13 | if( GAUXC_ENABLE_HOST ) 14 | include( host/gauxc-host.cmake ) 15 | endif() 16 | 17 | # Device Integrator Utilities 18 | if( GAUXC_ENABLE_DEVICE ) 19 | include( device/gauxc-device.cmake ) 20 | endif() 21 | -------------------------------------------------------------------------------- /attic/src/new_integrator/common/gauxc-common.cmake: -------------------------------------------------------------------------------- 1 | # Common Integrator Utilities 2 | target_sources( gauxc PRIVATE common/integrator_common.cxx ) 3 | 4 | -------------------------------------------------------------------------------- /attic/src/new_integrator/common/integrator_common.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "integrator_constants.hpp" 4 | #include 5 | 6 | namespace GauXC { 7 | namespace integrator { 8 | 9 | std::tuple< std::vector< std::array >, std::vector< int32_t > > 10 | gen_compressed_submat_map( const BasisSetMap& basis_set, 11 | const std::vector< int32_t >& shell_mask, 12 | const int32_t LDA, const int32_t block_size ); 13 | 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /attic/src/new_integrator/common/integrator_constants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | namespace integrator { 5 | 6 | template 7 | constexpr F magic_ssf_factor = 0.64; 8 | 9 | constexpr double ssf_weight_tol = 1e-10; 10 | 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/buffer_adaptor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | 5 | class buffer_adaptor { 6 | 7 | size_t nalloc_; 8 | size_t nleft_; 9 | void* top_; 10 | void* stack_; 11 | 12 | public: 13 | 14 | buffer_adaptor() = delete; 15 | 16 | inline buffer_adaptor( void* ptr, size_t len ) : 17 | nalloc_(len), 18 | nleft_(len), 19 | top_(ptr), 20 | stack_(ptr) { } 21 | 22 | template 23 | T* aligned_alloc( size_t len, 24 | size_t align = alignof(T) ) { 25 | 26 | char* old_stack = (char*)stack_; 27 | if( std::align( align, 28 | len*sizeof(T), 29 | stack_, 30 | nleft_ ) ) { 31 | 32 | T* result = reinterpret_cast(stack_); 33 | stack_ = (char*)stack_ + len*sizeof(T); 34 | nleft_ -= std::distance( old_stack, 35 | (char*)stack_ ); 36 | return result; 37 | 38 | } 39 | 40 | throw std::bad_alloc(); 41 | 42 | } 43 | 44 | inline void* stack() const {return stack_;} 45 | inline size_t nleft() const { return nleft_; } 46 | 47 | }; 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/cuda/collocation/collocation_device_constants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | namespace integrator { 5 | namespace cuda { 6 | 7 | constexpr double sqrt_15 = 3.872983346207417; 8 | constexpr double sqrt_3 = 1.7320508075688772; 9 | constexpr double sqrt_6 = 2.449489742783178; 10 | constexpr double sqrt_10 = 3.1622776601683795; 11 | 12 | } // namespace cuda 13 | } // namespace integrator 14 | } // namespace GauXC 15 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/cuda/collocation/scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/attic/src/new_integrator/device/cuda/collocation/scripts/__init__.py -------------------------------------------------------------------------------- /attic/src/new_integrator/device/cuda/collocation/templates/collocation_device_constants_template.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | namespace integrator { 5 | namespace cuda { 6 | 7 | $for( x in const_lines )\ 8 | $(x) 9 | $endfor\ 10 | 11 | } // namespace cuda 12 | } // namespace integrator 13 | } // namespace GauXC 14 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/cuda/cuda_alg_variant_control.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#define GAUXC_CUDA_ENABLE_COLLOCATION_SHMEM_COPY 4 | //#define GAUXC_CUDA_ENABLE_COMPACT_COLLOCATION 5 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/cuda/cuda_device_properties.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "cuda_runtime.h" 5 | 6 | #include "device/cuda/cuda_device_properties.hpp" 7 | 8 | namespace GauXC { 9 | namespace cuda { 10 | 11 | 12 | uint32_t get_submat_cut_block(int32_t LDA, int32_t device) { 13 | int l2_cache_size; 14 | cudaDeviceGetAttribute(&l2_cache_size, cudaDevAttrL2CacheSize, device); 15 | 16 | int l2_block_size = (int) sqrt(0.75 * ((double) l2_cache_size / 8)); 17 | int min_block_size = LDA / max_submat_blocks; 18 | 19 | int block_size = std::max(l2_block_size, min_block_size); 20 | block_size = std::min(block_size, LDA); 21 | 22 | return block_size; 23 | } 24 | 25 | uint32_t get_device_sm_count(int32_t device) { 26 | int num_sm; 27 | cudaDeviceGetAttribute(&num_sm, cudaDevAttrMultiProcessorCount, device); 28 | 29 | return num_sm; 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/cuda/cuda_device_properties.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace cuda { 6 | 7 | static constexpr uint32_t warp_size = 32; 8 | static constexpr uint32_t max_threads_per_thread_block = 1024; 9 | static constexpr uint32_t max_warps_per_thread_block = 10 | max_threads_per_thread_block / warp_size; 11 | 12 | static constexpr uint32_t max_submat_blocks = 10; 13 | 14 | // Properties for weight algorithm 15 | static constexpr uint32_t weight_unroll = 4; 16 | static_assert(weight_unroll == 4, "Weight unroll is only tested for value of 4"); 17 | static constexpr uint32_t weight_thread_block = 640; 18 | static constexpr uint32_t weight_thread_block_per_sm = 2; 19 | 20 | uint32_t get_submat_cut_block(int32_t LDA, int32_t device); 21 | uint32_t get_device_sm_count(int32_t device); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/cuda/cuda_inc_potential.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator { 6 | namespace cuda { 7 | 8 | using namespace GauXC::cuda; 9 | 10 | template 11 | void task_inc_potential( size_t ntasks, 12 | XCTaskDevice* device_tasks, 13 | T* V_device, 14 | size_t LDV, 15 | cudaStream_t stream ); 16 | 17 | } 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/cuda/cuda_pack_density.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator { 6 | namespace cuda { 7 | 8 | using namespace GauXC::cuda; 9 | 10 | template 11 | void task_pack_density_matrix( size_t ntasks, 12 | XCTaskDevice* device_tasks, 13 | T* P_device, 14 | size_t LDP, 15 | cudaStream_t stream ); 16 | 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/cuda/cuda_weights.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace GauXC { 7 | namespace integrator { 8 | namespace cuda { 9 | 10 | 11 | void cuda_reciprocal(size_t length, double* vec, cudaStream_t stream); 12 | 13 | template 14 | void partition_weights_cuda_SoA( XCWeightAlg weight_alg, 15 | size_t npts, 16 | size_t LDatoms, 17 | size_t natoms, 18 | const F* points_device, 19 | const int32_t* iparent_device, 20 | const F* dist_nearest_device, 21 | const F* rab_device, 22 | const F* atomic_coords_device, 23 | F* weights_device, 24 | F* dist_scratch_device, 25 | cudaStream_t stream ); 26 | 27 | 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/cuda/cuda_zmat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator { 6 | namespace cuda { 7 | 8 | using namespace GauXC::cuda; 9 | 10 | template 11 | void zmat_lda_cuda( size_t ntasks, 12 | int32_t max_nbf, 13 | int32_t max_npts, 14 | XCTaskDevice* tasks_device, 15 | cudaStream_t stream ); 16 | 17 | template 18 | void zmat_gga_cuda( size_t ntasks, 19 | int32_t max_nbf, 20 | int32_t max_npts, 21 | XCTaskDevice* tasks_device, 22 | cudaStream_t stream ); 23 | 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/gauxc-device.cmake: -------------------------------------------------------------------------------- 1 | target_sources( gauxc PRIVATE 2 | # Drivers 3 | device/local_work_replicated_shellbatched_exc_vxc.cxx 4 | 5 | # Interfaces 6 | device/incore_xc_device_integrator.cxx 7 | device/shellbatched_xc_device_integrator.cxx 8 | ) 9 | 10 | if( GAUXC_ENABLE_CUDA ) 11 | include( device/cuda/gauxc-cuda.cmake ) 12 | endif() 13 | 14 | 15 | if( GAUXC_ENABLE_HIP ) 16 | include( device/hip/gauxc-hip.cmake ) 17 | endif() 18 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/hip/collocation/collocation_device_constants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GauXC { 4 | namespace integrator { 5 | namespace hip { 6 | 7 | constexpr double sqrt_15 = 3.872983346207417; 8 | constexpr double sqrt_3 = 1.7320508075688772; 9 | constexpr double sqrt_6 = 2.449489742783178; 10 | constexpr double sqrt_10 = 3.1622776601683795; 11 | 12 | } // namespace hip 13 | } // namespace integrator 14 | } // namespace GauXC 15 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/hip/gauxc-hip.cmake: -------------------------------------------------------------------------------- 1 | find_package( hipblas REQUIRED ) 2 | #include( gauxc-cub ) 3 | 4 | target_sources( gauxc PRIVATE 5 | # Common HIP Utilities 6 | device/hip/collocation_device.hip 7 | device/hip/xc_hip_data.cxx 8 | device/hip/hip_weights.hip 9 | device/hip/hip_pack_density.hip 10 | device/hip/hip_eval_denvars.hip 11 | device/hip/hipblas_extensions.hip 12 | device/hip/hip_inc_potential.hip 13 | device/hip/hip_device_properties.cxx 14 | 15 | # XC Specific 16 | device/hip/hip_zmat.hip 17 | 18 | # Drivers 19 | device/hip/local_work_replicated_incore_exc_vxc.cxx 20 | 21 | ) 22 | 23 | #target_compile_features( gauxc PRIVATE hip_std_14 ) 24 | #target_compile_options( gauxc 25 | # PRIVATE 26 | # $<$: -Xhipfe --diag_suppress=partial_override -Xptxas -v > 27 | #) 28 | 29 | 30 | if( GAUXC_ENABLE_MAGMA ) 31 | 32 | message( STATUS "MAGMA Has Been Enabled" ) 33 | find_package( MAGMA REQUIRED ) 34 | target_link_libraries( gauxc PUBLIC MAGMA::magma ) 35 | 36 | else() 37 | 38 | message( STATUS "MAGMA Has Been Explicitly Disabled" ) 39 | 40 | endif() 41 | 42 | target_link_libraries( gauxc PUBLIC roc::hipblas ) 43 | #target_link_libraries( gauxc PRIVATE $ ) 44 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/hip/hip_alg_variant_control.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#define GAUXC_HIP_ENABLE_COLLOCATION_SHMEM_COPY 4 | //#define GAUXC_HIP_ENABLE_COMPACT_COLLOCATION 5 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/hip/hip_device_properties.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "hip_runtime.h" 5 | 6 | #include "device/hip/hip_device_properties.hpp" 7 | 8 | namespace GauXC { 9 | namespace hip { 10 | 11 | 12 | uint32_t get_submat_cut_block(int32_t LDA, int32_t device) { 13 | int l2_cache_size; 14 | hipDeviceGetAttribute(&l2_cache_size, hipDevAttrL2CacheSize, device); 15 | 16 | int l2_block_size = (int) sqrt(0.75 * ((double) l2_cache_size / 8)); 17 | int min_block_size = LDA / max_submat_blocks; 18 | 19 | int block_size = std::max(l2_block_size, min_block_size); 20 | block_size = std::min(block_size, LDA); 21 | 22 | return block_size; 23 | } 24 | 25 | uint32_t get_device_sm_count(int32_t device) { 26 | int num_sm; 27 | hipDeviceGetAttribute(&num_sm, hipDevAttrMultiProcessorCount, device); 28 | 29 | return num_sm; 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/hip/hip_device_properties.hip: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "hip/hip_runtime.h" 5 | 6 | #include "device/hip/hip_device_properties.hpp" 7 | 8 | namespace GauXC { 9 | namespace hip { 10 | 11 | 12 | uint32_t get_submat_cut_block(int32_t LDA, int32_t device) { 13 | int l2_cache_size; 14 | hipDeviceGetAttribute(&l2_cache_size, hipDeviceAttributeL2CacheSize, device); 15 | 16 | int l2_block_size = (int) sqrt(0.75 * ((double) l2_cache_size / 8)); 17 | int min_block_size = LDA / max_submat_blocks; 18 | 19 | int block_size = std::max(l2_block_size, min_block_size); 20 | block_size = std::min(block_size, LDA); 21 | 22 | return block_size; 23 | } 24 | 25 | uint32_t get_device_sm_count(int32_t device) { 26 | int num_sm; 27 | hipDeviceGetAttribute(&num_sm, hipDeviceAttributeMultiprocessorCount, device); 28 | 29 | return num_sm; 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/hip/hip_inc_potential.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator { 6 | namespace hip { 7 | 8 | using namespace GauXC::hip; 9 | 10 | template 11 | void task_inc_potential( size_t ntasks, 12 | XCTaskDevice* device_tasks, 13 | T* V_device, 14 | size_t LDV, 15 | hipStream_t stream ); 16 | 17 | } 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/hip/hip_pack_density.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator { 6 | namespace hip { 7 | 8 | using namespace GauXC::hip; 9 | 10 | template 11 | void task_pack_density_matrix( size_t ntasks, 12 | XCTaskDevice* device_tasks, 13 | T* P_device, 14 | size_t LDP, 15 | hipStream_t stream ); 16 | 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/hip/hip_weights.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace GauXC { 7 | namespace integrator { 8 | namespace hip { 9 | 10 | 11 | void hip_reciprocal(size_t length, double* vec, hipStream_t stream); 12 | 13 | template 14 | void partition_weights_hip_SoA( XCWeightAlg weight_alg, 15 | size_t npts, 16 | size_t LDatoms, 17 | size_t natoms, 18 | const F* points_device, 19 | const int32_t* iparent_device, 20 | const F* dist_nearest_device, 21 | const F* rab_device, 22 | const F* atomic_coords_device, 23 | F* weights_device, 24 | F* dist_scratch_device, 25 | hipStream_t stream ); 26 | 27 | 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/hip/hip_zmat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator { 6 | namespace hip { 7 | 8 | using namespace GauXC::hip; 9 | 10 | template 11 | void zmat_lda_hip( size_t ntasks, 12 | int32_t max_nbf, 13 | int32_t max_npts, 14 | XCTaskDevice* tasks_device, 15 | hipStream_t stream ); 16 | 17 | template 18 | void zmat_gga_hip( size_t ntasks, 19 | int32_t max_nbf, 20 | int32_t max_npts, 21 | XCTaskDevice* tasks_device, 22 | hipStream_t stream ); 23 | 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/incore_xc_device_integrator.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "device/incore_xc_device_exc_vxc.hpp" 4 | 5 | namespace GauXC { 6 | namespace detail { 7 | 8 | template 9 | IncoreXCDeviceIntegrator:: 10 | IncoreXCDeviceIntegrator( const IncoreXCDeviceIntegrator& ) = default; 11 | 12 | template 13 | IncoreXCDeviceIntegrator:: 14 | IncoreXCDeviceIntegrator( IncoreXCDeviceIntegrator&& ) noexcept = default; 15 | 16 | template 17 | IncoreXCDeviceIntegrator:: 18 | ~IncoreXCDeviceIntegrator() noexcept = default; 19 | 20 | 21 | 22 | 23 | 24 | template class IncoreXCDeviceIntegrator; 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/shellbatched_xc_device_integrator.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "device/shellbatched_xc_device_exc_vxc.hpp" 4 | 5 | namespace GauXC { 6 | namespace detail { 7 | 8 | template 9 | ShellBatchedXCDeviceIntegrator:: 10 | ShellBatchedXCDeviceIntegrator( const ShellBatchedXCDeviceIntegrator& ) = default; 11 | 12 | template 13 | ShellBatchedXCDeviceIntegrator:: 14 | ShellBatchedXCDeviceIntegrator( ShellBatchedXCDeviceIntegrator&& ) noexcept = default; 15 | 16 | template 17 | ShellBatchedXCDeviceIntegrator:: 18 | ~ShellBatchedXCDeviceIntegrator() noexcept = default; 19 | 20 | 21 | 22 | 23 | 24 | template class ShellBatchedXCDeviceIntegrator; 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /attic/src/new_integrator/device/xc_device_data.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace GauXC { 7 | 8 | template 9 | class XCDeviceData { 10 | 11 | public: 12 | 13 | virtual void allocate_static_data( size_t _natoms, 14 | size_t _n_deriv, 15 | size_t _nbf, 16 | size_t _nshells ) = 0; 17 | 18 | virtual ~XCDeviceData() noexcept = default; 19 | 20 | }; 21 | 22 | namespace integrator::device { 23 | 24 | template 25 | std::shared_ptr> make_device_data(); 26 | 27 | extern template std::shared_ptr> make_device_data(); 28 | 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /attic/src/new_integrator/host/blas.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC::blas { 5 | 6 | template 7 | void lacpy( char UPLO, int M, int N, const T* A, int LDA, T* B, 8 | int LDB ); 9 | 10 | template 11 | void gemm( char TA, char TB, int M, int N, int K, T ALPHA, 12 | const T* A, int LDA, const T* B, int LDB, T BETA, 13 | T* C, int LDC ); 14 | 15 | template 16 | void syr2k( char UPLO, char TRANS, int N, int K, T ALPHA, 17 | const T* A, int LDA, const T* B, int LDB, T BETA, 18 | T* C, int LDC ); 19 | 20 | 21 | template 22 | T dot( int N, const T* X, int INCX, const T* Y, int INCY ); 23 | 24 | template 25 | void axpy( int N, T ALPHA, const T* X, int INCX, T* Y, int INCY ); 26 | 27 | template 28 | void scal( int N, T ALPHA, T* X, int INCX ); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /attic/src/new_integrator/host/gauxc-host.cmake: -------------------------------------------------------------------------------- 1 | find_package( LAPACK REQUIRED ) 2 | include( gauxc-gau2grid ) 3 | target_sources( gauxc PRIVATE 4 | # Common Host Utilities 5 | host/host_weights.cxx 6 | host/host_collocation.cxx 7 | host/blas.cxx 8 | 9 | # XC Specific 10 | host/host_exc_vxc_zmat.cxx 11 | host/local_work_replicated_exc_vxc.cxx 12 | 13 | # Interfaces 14 | host/reference_xc_host_integrator.cxx 15 | ) 16 | 17 | target_link_libraries( gauxc PUBLIC LAPACK::LAPACK ) 18 | 19 | if( GAUXC_ENABLE_GAU2GRID ) 20 | target_link_libraries( gauxc PUBLIC gau2grid::gg ) 21 | endif() 22 | 23 | 24 | -------------------------------------------------------------------------------- /attic/src/new_integrator/host/host_collocation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace GauXC::integrator::host { 6 | 7 | void eval_collocation( size_t npts, 8 | size_t nshells, 9 | size_t nbe, 10 | const double* points, 11 | const BasisSet& basis, 12 | const int32_t* shell_mask, 13 | double* basis_eval ); 14 | 15 | void eval_collocation_deriv1( size_t npts, 16 | size_t nshells, 17 | size_t nbe, 18 | const double* points, 19 | const BasisSet& basis, 20 | const int32_t* shell_mask, 21 | double* basis_eval, 22 | double* dbasis_x_eval, 23 | double* dbasis_y_eval, 24 | double* dbasis_z_eval ); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /attic/src/new_integrator/host/host_exc_vxc_zmat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace GauXC { 5 | namespace integrator::host { 6 | 7 | template 8 | void zmat_lda_host( int32_t npts, 9 | int32_t nbf, 10 | const F* vrho, 11 | const F* basis, 12 | F* z_matrix ); 13 | 14 | template 15 | void zmat_gga_host( int32_t npts, 16 | int32_t nbf, 17 | const F* vrho, 18 | const F* vgamma, 19 | const F* basis, 20 | const F* dbasis_x, 21 | const F* dbasis_y, 22 | const F* dbasis_z, 23 | const F* dden_x, 24 | const F* dden_y, 25 | const F* dden_z, 26 | F* z_matrix ); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /attic/src/new_integrator/host/host_weights.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace GauXC::integrator::host { 6 | 7 | void partition_weights_host( 8 | XCWeightAlg weight_alg, 9 | const Molecule& mol, 10 | const MolMeta& meta, 11 | std::vector< XCTask >& tasks 12 | ); 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /attic/src/new_integrator/host/reference_xc_host_integrator.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "host/reference_xc_host_exc_vxc.hpp" 4 | 5 | namespace GauXC { 6 | namespace detail { 7 | 8 | template 9 | ReferenceXCHostIntegrator:: 10 | ReferenceXCHostIntegrator( const ReferenceXCHostIntegrator& ) = default; 11 | 12 | template 13 | ReferenceXCHostIntegrator:: 14 | ReferenceXCHostIntegrator( ReferenceXCHostIntegrator&& ) noexcept = default; 15 | 16 | template 17 | ReferenceXCHostIntegrator:: 18 | ~ReferenceXCHostIntegrator() noexcept = default; 19 | 20 | 21 | 22 | 23 | 24 | template class ReferenceXCHostIntegrator; 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /attic/src/new_integrator/host/xc_host_data.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | namespace GauXC { 8 | 9 | template 10 | struct XCHostData { 11 | 12 | std::vector eps; 13 | std::vector gamma; 14 | std::vector vrho; 15 | std::vector vgamma; 16 | 17 | std::vector zmat; 18 | std::vector nbe_scr; 19 | std::vector den_scr; 20 | std::vector basis_eval; 21 | 22 | 23 | XCHostData( size_t n_deriv, 24 | size_t nbf, 25 | size_t max_npts, 26 | size_t max_npts_x_nbe ) : 27 | eps( max_npts ), 28 | gamma( (n_deriv > 0) * max_npts ), 29 | vrho( max_npts ), 30 | vgamma( (n_deriv > 0) * max_npts ), 31 | zmat( max_npts_x_nbe ), 32 | nbe_scr( nbf * nbf ), 33 | den_scr( (3*n_deriv + 1) * max_npts ), 34 | basis_eval( (3*n_deriv + 1) * max_npts_x_nbe ) { } 35 | 36 | 37 | }; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /attic/src/new_integrator/replicated/gauxc-replicated.cmake: -------------------------------------------------------------------------------- 1 | # Implementations of generic interfaces 2 | target_sources( gauxc PRIVATE replicated/replicated_xc_integrator_impl.cxx ) 3 | 4 | if( GAUXC_ENABLE_HOST ) 5 | target_sources( gauxc PRIVATE replicated/reference_xc_host_integrator.cxx ) 6 | endif() 7 | 8 | -------------------------------------------------------------------------------- /cmake/BuildFindCereal.cmake: -------------------------------------------------------------------------------- 1 | find_package( cereal QUIET ) 2 | if( NOT cereal_FOUND ) 3 | 4 | include( gauxc-dep-versions ) 5 | 6 | message( STATUS "Could not find Cereal... Building" ) 7 | message( STATUS "CEREAL REPO = ${GAUXC_CEREAL_REPOSITORY}" ) 8 | message( STATUS "CEREAL REV = ${GAUXC_CEREAL_REVISION}" ) 9 | 10 | FetchContent_Declare( 11 | cereal 12 | GIT_REPOSITORY ${GAUXC_CEREAL_REPOSITORY} 13 | GIT_TAG ${GAUXC_CEREAL_REVISION} 14 | ) 15 | 16 | FetchContent_GetProperties(cereal) 17 | if(NOT cereal_POPULATED) 18 | FetchContent_Populate( cereal ) 19 | add_library( cereal INTERFACE IMPORTED ) 20 | set_target_properties( cereal PROPERTIES 21 | INTERFACE_INCLUDE_DIRECTORIES "${cereal_SOURCE_DIR}/include" 22 | INTERFACE_COMPILE_DEFINITIONS "CEREAL_THREAD_SAFE=1;GAUXC_HAS_CEREAL=1" 23 | ) 24 | endif() 25 | 26 | else() 27 | 28 | target_compile_definitions( cereal INTERFACE 29 | "CEREAL_THREAD_SAFE=1;GAUXC_HAS_CEREAL=1" 30 | ) 31 | 32 | endif() 33 | -------------------------------------------------------------------------------- /cmake/gauxc-cereal.cmake: -------------------------------------------------------------------------------- 1 | include( BuildFindCereal ) 2 | -------------------------------------------------------------------------------- /cmake/gauxc-cub.cmake: -------------------------------------------------------------------------------- 1 | if( GAUXC_HAS_CUDA ) 2 | 3 | find_package( CUDAToolkit REQUIRED ) 4 | if( CUDAToolkit_VERSION VERSION_LESS "11.0.0" ) 5 | include( gauxc-dep-versions ) 6 | 7 | message( STATUS "Building Local CUB Installation" ) 8 | message( STATUS "CUB REPO = ${GAUXC_CUB_REPOSITORY}" ) 9 | message( STATUS "CUB REV = ${GAUXC_CUB_REVISION}" ) 10 | 11 | FetchContent_Declare( 12 | cub 13 | GIT_REPOSITORY ${GAUXC_CUB_REPOSITORY} 14 | GIT_TAG ${GAUXC_CUB_REVISION} 15 | ) 16 | 17 | FetchContent_GetProperties( cub ) 18 | if( NOT cub_POPULATED ) 19 | FetchContent_Populate( cub ) 20 | endif() 21 | 22 | add_library( gauxc_cub INTERFACE IMPORTED ) 23 | set_target_properties( gauxc_cub PROPERTIES 24 | INTERFACE_INCLUDE_DIRECTORIES ${cub_SOURCE_DIR} 25 | ) 26 | else() 27 | message( STATUS "Using CUB from CUDAToolkit" ) 28 | message( STATUS " CUDATOOLKIT VERSION = ${CUDAToolkit_VERSION}" ) 29 | endif() 30 | 31 | endif() 32 | -------------------------------------------------------------------------------- /cmake/gauxc-cutlass.cmake: -------------------------------------------------------------------------------- 1 | # Check that only CUDA CC 8.0+ is enabled 2 | foreach( cuda_arch ${CMAKE_CUDA_ARCHITECTURES} ) 3 | if( NOT cuda_arch GREATER_EQUAL 80 ) 4 | message(FATAL_ERROR "GauXC Requires CUDA CC >= 8.0 For CUTLASS") 5 | endif() 6 | endforeach() 7 | 8 | include( gauxc-dep-versions ) 9 | 10 | message( STATUS "Building Local CUTLASS Installation" ) 11 | message( STATUS "CUTLASS REPO = ${GAUXC_CUTLASS_REPOSITORY}" ) 12 | message( STATUS "CUTLASS REV = ${GAUXC_CUTLASS_REVISION}" ) 13 | 14 | FetchContent_Declare( 15 | cutlass 16 | GIT_REPOSITORY ${GAUXC_CUTLASS_REPOSITORY} 17 | GIT_TAG ${GAUXC_CUTLASS_REVISION} 18 | ) 19 | 20 | FetchContent_GetProperties( cutlass ) 21 | if( NOT cutlass_POPULATED ) 22 | FetchContent_Populate( cutlass ) 23 | endif() 24 | 25 | 26 | 27 | add_library( gauxc_cutlass INTERFACE IMPORTED ) 28 | set_target_properties( gauxc_cutlass PROPERTIES 29 | INTERFACE_INCLUDE_DIRECTORIES 30 | "${cutlass_SOURCE_DIR}/include;${cutlass_SOURCE_DIR}/tools/util/include" 31 | ) 32 | 33 | set(GAUXC_HAS_CUTLASS TRUE CACHE BOOL "GauXC has CUTLASS" FORCE) 34 | -------------------------------------------------------------------------------- /cmake/gauxc-dep-versions.cmake: -------------------------------------------------------------------------------- 1 | set( GAUXC_LINALG_MODULES_REPOSITORY https://github.com/wavefunction91/linalg-cmake-modules.git ) 2 | set( GAUXC_LINALG_MODULES_REVISION 28ceaa9738f14935aa544289fa2fe4c4cc955d0e ) 3 | 4 | set( GAUXC_CEREAL_REPOSITORY https://github.com/USCiLab/cereal.git ) 5 | set( GAUXC_CEREAL_REVISION v1.3.0 ) 6 | 7 | set( GAUXC_CUB_REPOSITORY https://github.com/NVIDIA/cub.git ) 8 | set( GAUXC_CUB_REVISION 1.10.0 ) 9 | 10 | set( GAUXC_CUTLASS_REPOSITORY https://github.com/NVIDIA/cutlass.git ) 11 | set( GAUXC_CUTLASS_REVISION v2.10.0 ) 12 | 13 | set( GAUXC_EXCHCXX_REPOSITORY https://github.com/wavefunction91/ExchCXX.git ) 14 | set( GAUXC_EXCHCXX_REVISION 21a4700a826ec0beae1311a1d59677393bcb168f ) 15 | 16 | set( GAUXC_GAU2GRID_REPOSITORY https://github.com/dgasmith/gau2grid.git ) 17 | set( GAUXC_GAU2GRID_REVISION v2.0.6 ) 18 | 19 | set( GAUXC_INTEGRATORXX_REPOSITORY https://github.com/wavefunction91/IntegratorXX.git ) 20 | set( GAUXC_INTEGRATORXX_REVISION ea07dedd37e7bd49ea06394eb811599002b34b49 ) 21 | 22 | set( GAUXC_HIGHFIVE_REPOSITORY https://github.com/BlueBrain/HighFive.git ) 23 | set( GAUXC_HIGHFIVE_REVISION 805f0e13d09b47c4b01d40682621904aa3b31bb8 ) 24 | -------------------------------------------------------------------------------- /cmake/gauxc-eigen3.cmake: -------------------------------------------------------------------------------- 1 | find_package( Eigen3 CONFIG HINTS ${EIGEN3_ROOT_DIR} ) 2 | if( NOT Eigen3_FOUND ) 3 | 4 | message( STATUS "Could Not Find Eigen3... Building" ) 5 | message( STATUS "EIGEN3 REPO = https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz" ) 6 | #message( STATUS "EIGEN3 REV = " ) 7 | 8 | FetchContent_Declare( 9 | eigen3 10 | URL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz 11 | ) 12 | 13 | FetchContent_GetProperties( eigen3 ) 14 | if( NOT eigen3_POPULATED ) 15 | FetchContent_Populate( eigen3 ) 16 | endif() 17 | 18 | #message( FATAL_ERROR "Eigen3 Pull Not Yet Configured" ) 19 | add_library( Eigen3::Eigen INTERFACE IMPORTED ) 20 | set_target_properties( Eigen3::Eigen PROPERTIES 21 | INTERFACE_INCLUDE_DIRECTORIES ${eigen3_SOURCE_DIR} 22 | ) 23 | 24 | endif() 25 | 26 | -------------------------------------------------------------------------------- /cmake/gauxc-exchcxx.cmake: -------------------------------------------------------------------------------- 1 | find_package( ExchCXX QUIET ) 2 | if( NOT ${ExchCXX_FOUND} ) 3 | 4 | include( gauxc-dep-versions ) 5 | 6 | message( STATUS "Could not find ExchCXX... Building" ) 7 | message( STATUS "EXCHCXX REPO = ${GAUXC_EXCHCXX_REPOSITORY}" ) 8 | message( STATUS "EXCHCXX REV = ${GAUXC_EXCHCXX_REVISION}" ) 9 | 10 | set( EXCHCXX_ENABLE_CUDA ${GAUXC_HAS_CUDA} CACHE BOOL "" ) 11 | set( EXCHCXX_ENABLE_HIP ${GAUXC_HAS_HIP} CACHE BOOL "" ) 12 | set( EXCHCXX_ENABLE_TESTS OFF CACHE BOOL "" ) 13 | 14 | FetchContent_Declare( 15 | exchcxx 16 | GIT_REPOSITORY ${GAUXC_EXCHCXX_REPOSITORY} 17 | GIT_TAG ${GAUXC_EXCHCXX_REVISION} 18 | ) 19 | 20 | FetchContent_MakeAvailable( exchcxx ) 21 | 22 | 23 | else() 24 | 25 | if( ${GAUXC_HAS_CUDA} AND NOT ${EXCHCXX_ENABLE_CUDA} ) 26 | message( FATAL_ERROR "GauXC CUDA BINDINGS REQUIRE ExchCXX CUDA Bindings" ) 27 | endif() 28 | 29 | if( ${GAUXC_HAS_HIP} AND NOT ${EXCHCXX_ENABLE_HIP} ) 30 | message( FATAL_ERROR "GauXC HIP BINDINGS REQUIRE ExchCXX HIP Bindings" ) 31 | endif() 32 | 33 | endif() 34 | 35 | 36 | -------------------------------------------------------------------------------- /cmake/gauxc-integratorxx.cmake: -------------------------------------------------------------------------------- 1 | find_package( IntegratorXX QUIET ) 2 | if( NOT ${IntegratorXX_FOUND} ) 3 | 4 | include( gauxc-dep-versions ) 5 | 6 | message( STATUS "Could not find IntegratorXX... Building" ) 7 | message( STATUS "INTEGRATORXX REPO = ${GAUXC_INTEGRATORXX_REPOSITORY}" ) 8 | message( STATUS "INTEGRATORXX REV = ${GAUXC_INTEGRATORXX_REVISION}" ) 9 | 10 | set( INTEGRATORXX_ENABLE_TESTS OFF CACHE BOOL "" ) 11 | FetchContent_Declare( 12 | integratorxx 13 | GIT_REPOSITORY ${GAUXC_INTEGRATORXX_REPOSITORY} 14 | GIT_TAG ${GAUXC_INTEGRATORXX_REVISION} 15 | ) 16 | 17 | FetchContent_MakeAvailable( integratorxx ) 18 | 19 | endif() 20 | 21 | 22 | -------------------------------------------------------------------------------- /cmake/gauxc-linalg-modules.cmake: -------------------------------------------------------------------------------- 1 | include( FetchContent ) 2 | include( gauxc-dep-versions ) 3 | FetchContent_Declare( linalg-cmake-modules 4 | GIT_REPOSITORY ${GAUXC_LINALG_MODULES_REPOSITORY} 5 | GIT_TAG ${GAUXC_LINALG_MODULES_REVISION} 6 | ) 7 | FetchContent_GetProperties( linalg-cmake-modules ) 8 | if( NOT linalg-cmake-modules_POPULATED ) 9 | FetchContent_Populate( linalg-cmake-modules ) 10 | list( PREPEND CMAKE_MODULE_PATH ${linalg-cmake-modules_SOURCE_DIR} ) 11 | endif() 12 | -------------------------------------------------------------------------------- /cmake/modules/FindMAGMA.cmake: -------------------------------------------------------------------------------- 1 | if( NOT DEFINED MAGMA_ROOT_DIR ) 2 | find_package(PkgConfig) 3 | pkg_check_modules( PC_MAGMA magma ) 4 | endif() 5 | 6 | if( NOT MAGMA_INCLUDE_DIR ) 7 | find_path( MAGMA_INCLUDE_DIR magma.h 8 | HINTS ${PC_MAGMA_INCLUDEDIR} 9 | ${PC_MAGMA_INCLUDE_DIRS} 10 | PATHS ${MAGMA_ROOT_DIR} 11 | PATH_SUFFIXES include 12 | ) 13 | endif() 14 | 15 | if(NOT MAGMA_LIBRARY) 16 | find_library( MAGMA_LIBRARY NAMES magma 17 | HINTS ${PC_MAGMA_LIBDIR} 18 | ${PC_MAGMA_LIBRARY_DIRS} 19 | PATHS ${MAGMA_ROOT_DIR} 20 | PATH_SUFFIXES lib lib64 lib32 21 | ) 22 | endif() 23 | 24 | include(FindPackageHandleStandardArgs) 25 | find_package_handle_standard_args( 26 | MAGMA DEFAULT_MSG 27 | MAGMA_LIBRARY 28 | MAGMA_INCLUDE_DIR 29 | ) 30 | 31 | if( MAGMA_FOUND AND NOT TARGET MAGMA::magma ) 32 | 33 | set( MAGMA_INCLUDE_DIRS ${MAGMA_INCLUDE_DIR} ) 34 | set( MAGMA_LIBRARIES ${MAGMA_LIBRARY} ) 35 | 36 | add_library( MAGMA::magma INTERFACE IMPORTED ) 37 | set_target_properties( MAGMA::magma PROPERTIES 38 | INTERFACE_INCLUDE_DIRECTORIES "${MAGMA_INCLUDE_DIRS}" 39 | INTERFACE_LINK_LIBRARIES "${MAGMA_LIBRARIES}" 40 | ) 41 | 42 | endif() 43 | 44 | -------------------------------------------------------------------------------- /cmake/modules/FindNCCL.cmake: -------------------------------------------------------------------------------- 1 | if( NOT DEFINED NCCL_ROOT_DIR ) 2 | find_package(PkgConfig) 3 | pkg_check_modules( PC_NCCL QUIET nccl ) 4 | endif() 5 | 6 | find_path( NCCL_INCLUDE_DIR nccl.h 7 | HINTS ${PC_NCCL_INCLUDEDIR} 8 | ${PC_NCCL_INCLUDE_DIRS} 9 | PATHS ${NCCL_ROOT_DIR} 10 | PATH_SUFFIXES include 11 | ) 12 | 13 | find_library( NCCL_LIBRARY NAMES nccl 14 | HINTS ${PC_NCCL_LIBDIR} 15 | ${PC_NCCL_LIBRARY_DIRS} 16 | PATHS ${NCCL_ROOT_DIR} 17 | PATH_SUFFIXES lib lib64 lib32 18 | ) 19 | 20 | include(FindPackageHandleStandardArgs) 21 | find_package_handle_standard_args( 22 | NCCL DEFAULT_MSG 23 | NCCL_LIBRARY 24 | NCCL_INCLUDE_DIR 25 | ) 26 | 27 | if( NCCL_FOUND AND NOT TARGET NCCL::nccl ) 28 | 29 | set( NCCL_INCLUDE_DIRS ${NCCL_INCLUDE_DIR} ) 30 | set( NCCL_LIBRARIES ${NCCL_LIBRARY} ) 31 | 32 | add_library( NCCL::nccl INTERFACE IMPORTED ) 33 | set_target_properties( NCCL::nccl PROPERTIES 34 | INTERFACE_INCLUDE_DIRECTORIES "${NCCL_INCLUDE_DIRS}" 35 | INTERFACE_LINK_LIBRARIES "${NCCL_LIBRARIES}" 36 | ) 37 | 38 | endif() 39 | 40 | -------------------------------------------------------------------------------- /external/gau2grid/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This CMake harness is meant for use with the GauXC library 2 | # and is released under the terms of the 3-clause BSD license 3 | 4 | target_sources( gauxc PRIVATE 5 | ${CMAKE_CURRENT_SOURCE_DIR}/generated_source/gau2grid_phi.c 6 | ${CMAKE_CURRENT_SOURCE_DIR}/generated_source/gau2grid_orbital.c 7 | ${CMAKE_CURRENT_SOURCE_DIR}/generated_source/gau2grid_deriv1.c 8 | ${CMAKE_CURRENT_SOURCE_DIR}/generated_source/gau2grid_deriv2.c 9 | ${CMAKE_CURRENT_SOURCE_DIR}/generated_source/gau2grid_deriv3.c 10 | ${CMAKE_CURRENT_SOURCE_DIR}/generated_source/gau2grid_transform.c 11 | ${CMAKE_CURRENT_SOURCE_DIR}/generated_source/gau2grid_helper.c ) 12 | 13 | 14 | target_compile_definitions( gauxc PRIVATE $ ) 15 | target_include_directories( gauxc 16 | PRIVATE 17 | $ 18 | ) 19 | -------------------------------------------------------------------------------- /external/gau2grid/README.txt: -------------------------------------------------------------------------------- 1 | This folder contains pregenerated source for the gau2grid library for gaussian 2 | collocation evaluation. See LICENSE for library specific terms. 3 | -------------------------------------------------------------------------------- /external/gau2grid/src/.clang-format: -------------------------------------------------------------------------------- 1 | Language: Cpp 2 | BasedOnStyle: Google 3 | IndentWidth: 4 4 | ColumnLimit: 120 5 | SortIncludes: false 6 | -------------------------------------------------------------------------------- /external/gau2grid/src/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | status: 3 | patch: false 4 | project: 5 | default: 6 | threshold: 50% 7 | comment: 8 | layout: "header" 9 | require_changes: false 10 | branches: null 11 | behavior: default 12 | flags: null 13 | paths: null 14 | -------------------------------------------------------------------------------- /external/gau2grid/src/.lgtm.yml: -------------------------------------------------------------------------------- 1 | # Configure LGTM for this package 2 | 3 | extraction: 4 | python: # Configure Python 5 | python_setup: # Configure the setup 6 | version: 3 # Specify Version 3 7 | cpp: 8 | prepare: 9 | packages: 10 | - python3-numpy 11 | 12 | path_classifiers: 13 | test: 14 | - scripts/* 15 | library: 16 | - versioneer.py # Set Versioneer.py to an external "library" (3rd party code) 17 | generated: 18 | - gau2grid/_version.py 19 | -------------------------------------------------------------------------------- /external/gau2grid/src/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include gau2grid *.py 2 | 3 | include setup.py 4 | include README.md 5 | include LICENSE 6 | include MANIFEST.in 7 | 8 | include versioneer.py 9 | include gau2grid/_version.py 10 | -------------------------------------------------------------------------------- /external/gau2grid/src/appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2017 2 | clone_depth: 5 3 | 4 | install: 5 | - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" 6 | - C:\Miniconda36-x64\Scripts\activate base 7 | - conda install --yes numpy pytest 8 | - conda list 9 | 10 | before_build: 11 | - set SOURCE_FOLDER=%APPVEYOR_BUILD_FOLDER% 12 | - set BUILD_FOLDER=%SOURCE_FOLDER%\build 13 | - set INSTALL_FOLDER=%SOURCE_FOLDER%\install 14 | - mkdir %BUILD_FOLDER% & cd %BUILD_FOLDER% 15 | - cmake -A x64 16 | -DCMAKE_C_FLAGS="/wd4018 /wd4101 /wd4996" 17 | -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=true 18 | -DCMAKE_INSTALL_PREFIX=%INSTALL_FOLDER% 19 | -DINSTALL_PYMOD=ON 20 | .. 21 | 22 | build_script: 23 | - cmake --build . 24 | 25 | after_build: 26 | - cmake --build . --target install 27 | 28 | before_test: 29 | - cd .. 30 | - set PYTHONPATH=%INSTALL_FOLDER%\lib 31 | 32 | test_script: 33 | - set GAU2GRID_FORCE_C_TEST=1 34 | - pytest -rws -v %INSTALL_FOLDER% 35 | -------------------------------------------------------------------------------- /external/gau2grid/src/cmake/autocmake_safeguards.cmake: -------------------------------------------------------------------------------- 1 | # Downloaded from 2 | # https://github.com/coderefinery/autocmake/blob/master/modules/safeguards.cmake 3 | # * changed text of in-source message 4 | 5 | #.rst: 6 | # 7 | # Provides safeguards against in-source builds and bad build types. 8 | # 9 | # Variables used:: 10 | # 11 | # PROJECT_SOURCE_DIR 12 | # PROJECT_BINARY_DIR 13 | # CMAKE_BUILD_TYPE 14 | 15 | if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR}) 16 | message(FATAL_ERROR "In-source builds not allowed. Please run CMake from top directory and specify a build directory (e.g., cmake -H. -Bbuild).") 17 | endif() 18 | 19 | string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower) 20 | string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper) 21 | 22 | if(NOT cmake_build_type_tolower STREQUAL "debug" AND 23 | NOT cmake_build_type_tolower STREQUAL "release" AND 24 | NOT cmake_build_type_tolower STREQUAL "relwithdebinfo") 25 | message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo (case-insensitive).") 26 | endif() 27 | -------------------------------------------------------------------------------- /external/gau2grid/src/devtools/README.md: -------------------------------------------------------------------------------- 1 | # Development, testing, and deployment tools 2 | 3 | This directory contains a collection of tools for running Continuous Integration (CI) tests, 4 | conda installation, and other development tools not directly related to the coding process. 5 | 6 | 7 | ## Manifest 8 | 9 | ### Continuous Integration 10 | 11 | You should test your code, but do not feel compelled to use these specific programs. You also may not need Unix and 12 | Windows testing if you only plan to deploy on specific platforms. These are just to help you get started 13 | 14 | * `travis-ci`: Linux and OSX based testing through [Travis-CI](https://about.travis-ci.com/) 15 | * `before_install.sh`: Pip/Miniconda installation script for Travis 16 | 17 | -------------------------------------------------------------------------------- /external/gau2grid/src/devtools/conda-envs/base.yaml: -------------------------------------------------------------------------------- 1 | name: qcarchive 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - python 7 | - numpy 8 | - cmake 9 | 10 | # Test depends 11 | - pytest 12 | - pytest-cov 13 | - codecov 14 | 15 | -------------------------------------------------------------------------------- /external/gau2grid/src/docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = gau2grid 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /external/gau2grid/src/docs/requirements.yml: -------------------------------------------------------------------------------- 1 | name: qcfractal-docs 2 | channels: 3 | - defaults 4 | dependencies: 5 | - python=3 6 | - numpy 7 | - sphinx 8 | - sphinx_rtd_theme 9 | -------------------------------------------------------------------------------- /external/gau2grid/src/docs/source/py_api.rst: -------------------------------------------------------------------------------- 1 | API Reference 2 | ============= 3 | 4 | .. autofunction:: gau2grid.collocation 5 | 6 | .. autofunction:: gau2grid.collocation_basis 7 | 8 | .. autofunction:: gau2grid.orbital 9 | 10 | .. autofunction:: gau2grid.orbital_basis 11 | 12 | -------------------------------------------------------------------------------- /external/gau2grid/src/docs/source/py_install.rst: -------------------------------------------------------------------------------- 1 | Python installation 2 | =================== 3 | 4 | You can install gau2grid with ``conda`` or by installing from source. 5 | 6 | Conda 7 | ----- 8 | 9 | You can update gau2grid using `conda `_:: 10 | 11 | conda install pygau2grid -c psi4 12 | 13 | This installs gau2grid and the NumPy dependancy. 14 | 15 | 16 | Install from Source 17 | ------------------- 18 | 19 | To install gau2grid from source, clone the repository from `github 20 | `_:: 21 | 22 | git clone https://github.com/dgasmith/gau2grid.git 23 | cd gau2grid 24 | python setup.py install 25 | 26 | 27 | Test 28 | ---- 29 | 30 | Test gau2grid with ``py.test``:: 31 | 32 | cd gau2grid 33 | py.test 34 | -------------------------------------------------------------------------------- /external/gau2grid/src/gau2grid/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Gau2grid base init 3 | """ 4 | 5 | from . import RSH 6 | from . import c_generator as c_gen 7 | from . import codegen 8 | from . import order 9 | from . import python_reference as ref 10 | 11 | # Pull in code from the c wrapper 12 | from .c_wrapper import (orbital, orbital_basis, collocation, collocation_basis, c_compiled, cgg_path, ncomponents, get_cgg_shared_object) 13 | # Pull in tests 14 | from .extras import test 15 | 16 | # Handle versioneer 17 | from ._version import get_versions 18 | 19 | versions = get_versions() 20 | __version__ = versions['version'] 21 | __git_revision__ = versions['full-revisionid'] 22 | del get_versions, versions 23 | -------------------------------------------------------------------------------- /external/gau2grid/src/gau2grid/extras.py: -------------------------------------------------------------------------------- 1 | """ 2 | Additional functionality not directly related to gau2grid. 3 | """ 4 | 5 | import os 6 | 7 | # Testing 8 | def test(): 9 | """ 10 | Runs a smoke test suite through pytest. 11 | """ 12 | 13 | try: 14 | import pytest 15 | except ImportError: 16 | raise RuntimeError('Testing module `pytest` is not installed. Run `conda install pytest`') 17 | 18 | abs_test_dir = os.path.sep.join([os.path.abspath(os.path.dirname(__file__)), "tests"]) 19 | retcode = pytest.main(['-rws', '-v', '--capture=sys', abs_test_dir]) 20 | return retcode 21 | -------------------------------------------------------------------------------- /external/gau2grid/src/gau2grid/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/external/gau2grid/src/gau2grid/tests/__init__.py -------------------------------------------------------------------------------- /external/gau2grid/src/make_source.py: -------------------------------------------------------------------------------- 1 | import gau2grid as gg 2 | gg.c_gen.generate_c_gau2grid(2, path='build_tmp') 3 | -------------------------------------------------------------------------------- /external/gau2grid/src/readthedocs.yml: -------------------------------------------------------------------------------- 1 | conda: 2 | file: docs/requirements.yml 3 | python: 4 | version: 3 5 | -------------------------------------------------------------------------------- /external/gau2grid/src/scripts/rsh_coef_gen.py: -------------------------------------------------------------------------------- 1 | """ 2 | Builds a new RSH dictionary for gau2grid. 3 | """ 4 | import gau2grid 5 | import numpy as np 6 | import decimal 7 | import pickle 8 | import time 9 | np.set_printoptions(precision=60) 10 | 11 | t = time.time() 12 | rsh_dict = {} 13 | for AM in range(9): 14 | print("AM %d" % AM) 15 | data = gau2grid.RSH.cart_to_RSH_coeffs(AM, gen=True) 16 | rsh_dict[AM] = data 17 | print(time.time() - t) 18 | 19 | with open("rsh_coeffs.pkl", "wb") as handle: 20 | pickle.dump(rsh_dict, handle, protocol=2) 21 | 22 | 23 | with open("rsh_coeffs.pkl", "rb") as handle: 24 | data = pickle.load(handle) 25 | 26 | for x in range(5): 27 | print(data[x]) 28 | -------------------------------------------------------------------------------- /external/gau2grid/src/setup.cfg: -------------------------------------------------------------------------------- 1 | # Helper file to handle all configs 2 | 3 | [coverage:run] 4 | # .coveragerc to control coverage.py and pytest-cov 5 | # Omit the test directory from test coverage 6 | omit = 7 | */tests/* 8 | gau2grid/_version.py 9 | 10 | 11 | [yapf] 12 | # YAPF, in .style.yapf files this shows up as "[style]" header 13 | COLUMN_LIMIT = 119 14 | INDENT_WIDTH = 4 15 | USE_TABS = False 16 | 17 | [flake8] 18 | # Flake8, PyFlakes, etc 19 | max-line-length = 119 20 | 21 | [versioneer] 22 | # Automatic version numbering scheme 23 | VCS = git 24 | style = pep440 25 | versionfile_source = gau2grid/_version.py 26 | versionfile_build = gau2grid/_version.py 27 | tag_prefix = '' 28 | -------------------------------------------------------------------------------- /include/gauxc/external/cereal.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | -------------------------------------------------------------------------------- /include/gauxc/gauxc_config.hpp.in: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #cmakedefine GAUXC_HAS_HOST 11 | #cmakedefine GAUXC_HAS_CUDA 12 | #cmakedefine GAUXC_HAS_HIP 13 | #cmakedefine GAUXC_HAS_MPI 14 | #cmakedefine GAUXC_HAS_MAGMA 15 | #cmakedefine GAUXC_HAS_NCCL 16 | #cmakedefine GAUXC_HAS_CUTLASS 17 | #cmakedefine GAUXC_HAS_GAU2GRID 18 | #cmakedefine GAUXC_HAS_HDF5 19 | #cmakedefine GAUXC_USE_FAST_RSQRT 20 | 21 | #ifdef GAUXC_HAS_HOST 22 | #cmakedefine GAUXC_CPU_XC_MAX_AM @GAUXC_CPU_XC_MAX_AM@ 23 | #cmakedefine GAUXC_CPU_SNLINK_MAX_AM @GAUXC_CPU_SNLINK_MAX_AM@ 24 | #endif 25 | 26 | #cmakedefine GAUXC_HAS_DEVICE 27 | #ifdef GAUXC_HAS_DEVICE 28 | #cmakedefine GAUXC_GPU_XC_MAX_AM @GAUXC_GPU_XC_MAX_AM@ 29 | #cmakedefine GAUXC_GPU_SNLINK_MAX_AM @GAUXC_GPU_SNLINK_MAX_AM@ 30 | #endif 31 | 32 | #if defined(__CUDACC__) || defined(__HIPCC__) 33 | #define HOST_DEVICE_ACCESSIBLE __host__ __device__ 34 | #else 35 | #define HOST_DEVICE_ACCESSIBLE 36 | #endif 37 | -------------------------------------------------------------------------------- /include/gauxc/molgrid.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | namespace GauXC { 17 | 18 | using atomic_grid_map = std::unordered_map< AtomicNumber, Grid >; 19 | using atomic_grid_spec_map = std::unordered_map< AtomicNumber, atomic_grid_variant>; 20 | 21 | namespace detail { 22 | class MolGridImpl; 23 | } 24 | 25 | class MolGrid { 26 | 27 | std::shared_ptr pimpl_; 28 | 29 | public: 30 | 31 | MolGrid( const atomic_grid_map& ); 32 | MolGrid( const atomic_grid_spec_map& ); 33 | 34 | MolGrid( const MolGrid& ); 35 | MolGrid( MolGrid&& ) noexcept; 36 | 37 | ~MolGrid() noexcept; 38 | 39 | size_t natoms_uniq() const; 40 | const Grid& get_grid( AtomicNumber ) const; 41 | Grid& get_grid( AtomicNumber ) ; 42 | 43 | size_t max_nbatches() const; 44 | 45 | }; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /include/gauxc/runtime_environment.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | -------------------------------------------------------------------------------- /include/gauxc/runtime_environment/fwd.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | 11 | namespace GauXC { 12 | 13 | class RuntimeEnvironment; 14 | 15 | #ifdef GAUXC_HAS_DEVICE 16 | class DeviceRuntimeEnvironment; 17 | class DeviceBackend; 18 | #endif 19 | } 20 | -------------------------------------------------------------------------------- /include/gauxc/types.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | namespace GauXC { 17 | 18 | using functional_type = ExchCXX::XCFunctional; 19 | //using quadrature_type = IntegratorXX::QuadratureBase< 20 | // std::vector>, 21 | // std::vector 22 | //>; 23 | using quadrature_type = IntegratorXX::SphericalQuadratureBase< 24 | std::vector>, 25 | std::vector 26 | >; 27 | 28 | using batcher_type = IntegratorXX::SphericalMicroBatcher< 29 | typename quadrature_type::point_container, 30 | typename quadrature_type::weight_container 31 | >; 32 | 33 | } 34 | 35 | #include 36 | -------------------------------------------------------------------------------- /include/gauxc/util/contiguous_container_data.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | #include 11 | 12 | namespace GauXC { 13 | namespace detail { 14 | 15 | template 16 | inline HOST_DEVICE_ACCESSIBLE T* contiguous_data( const std::array& arr ) { 17 | return reinterpret_cast( &const_cast&>(arr) ); 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /include/gauxc/util/environment.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | #include 11 | 12 | namespace GauXC { 13 | 14 | inline int gauxc_max_am(ExecutionSpace ex, SupportedAlg alg) { 15 | switch(ex) { 16 | #ifdef GAUXC_HAS_HOST 17 | case ExecutionSpace::Host: 18 | switch(alg) { 19 | case SupportedAlg::XC: 20 | case SupportedAlg::DEN: 21 | return GAUXC_CPU_XC_MAX_AM; 22 | case SupportedAlg::SNLINK: 23 | return GAUXC_CPU_SNLINK_MAX_AM; 24 | default: return -1; 25 | } 26 | #endif 27 | #ifdef GAUXC_HAS_DEVICE 28 | case ExecutionSpace::Device: 29 | switch(alg) { 30 | case SupportedAlg::XC: 31 | case SupportedAlg::DEN: 32 | return GAUXC_GPU_XC_MAX_AM; 33 | case SupportedAlg::SNLINK: 34 | return GAUXC_GPU_SNLINK_MAX_AM; 35 | default: return -1; 36 | } 37 | #endif 38 | default: return -1; 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /include/gauxc/util/unused.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace GauXC::util { 13 | 14 | inline static void unused() { } 15 | 16 | template 17 | inline static void unused( const T& t, Args&&... args ) { 18 | (void)(t); 19 | unused( std::forward(args)... ); 20 | } 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /include/gauxc/xc_integrator_settings.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | namespace GauXC { 11 | 12 | struct IntegratorSettingsEXX { virtual ~IntegratorSettingsEXX() noexcept = default; }; 13 | struct IntegratorSettingsSNLinK : public IntegratorSettingsEXX { 14 | bool screen_ek = true; 15 | double energy_tol = 1e-10; 16 | double k_tol = 1e-10; 17 | }; 18 | 19 | struct IntegratorSettingsXC { virtual ~IntegratorSettingsXC() noexcept = default; }; 20 | struct IntegratorSettingsKS : public IntegratorSettingsXC { 21 | double gks_dtol = 1e-12; 22 | }; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/grid.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "grid_impl.hpp" 9 | 10 | 11 | namespace GauXC { 12 | 13 | Grid::Grid( std::shared_ptr q, BatchSize bsz ) : 14 | pimpl_( std::make_shared(q, bsz) ) { } 15 | 16 | Grid::Grid( const Grid& ) = default; 17 | Grid::Grid( Grid&& ) noexcept = default; 18 | 19 | Grid& Grid::operator=( const Grid& ) = default; 20 | Grid& Grid::operator=( Grid&& ) noexcept = default; 21 | 22 | Grid::~Grid() noexcept = default; 23 | 24 | const batcher_type& Grid::batcher() const { return pimpl_->batcher(); } 25 | batcher_type& Grid::batcher() { return pimpl_->batcher(); } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/grid_impl.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "grid_impl.hpp" 9 | 10 | namespace GauXC { 11 | namespace detail { 12 | 13 | GridImpl::GridImpl( std::shared_ptr q, BatchSize bs ) : quad_(q) { 14 | generate_batcher(bs); 15 | } 16 | 17 | GridImpl::GridImpl( const GridImpl& ) = default; 18 | GridImpl::GridImpl( GridImpl&& ) noexcept = default; 19 | 20 | GridImpl& GridImpl::operator=( const GridImpl& ) = default; 21 | GridImpl& GridImpl::operator=( GridImpl&& ) noexcept = default; 22 | 23 | GridImpl::~GridImpl() noexcept = default; 24 | 25 | const batcher_type& GridImpl::batcher() const { return *batcher_; } 26 | batcher_type& GridImpl::batcher() { return *batcher_; } 27 | 28 | void GridImpl::generate_batcher(BatchSize max_batch_sz) { 29 | 30 | batcher_ = std::make_shared< batcher_type >( 31 | max_batch_sz.get(), quad_ 32 | ); 33 | 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/grid_impl.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace GauXC { 13 | namespace detail { 14 | 15 | class GridImpl { 16 | 17 | std::shared_ptr< quadrature_type > quad_ = nullptr; 18 | std::shared_ptr< batcher_type > batcher_ = nullptr; 19 | 20 | void generate_batcher(BatchSize); 21 | 22 | public: 23 | 24 | GridImpl() = delete; 25 | 26 | GridImpl( std::shared_ptr q, BatchSize ); 27 | 28 | GridImpl( const GridImpl& ); 29 | GridImpl( GridImpl&& ) noexcept; 30 | 31 | GridImpl& operator=( const GridImpl& ); 32 | GridImpl& operator=( GridImpl&& ) noexcept; 33 | 34 | ~GridImpl() noexcept; 35 | 36 | const batcher_type& batcher() const; 37 | batcher_type& batcher() ; 38 | 39 | }; 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/load_balancer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE 9 | load_balancer.cxx 10 | load_balancer_impl.cxx 11 | load_balancer_factory.cxx 12 | rebalance.cxx 13 | 14 | host/load_balancer_host_factory.cxx 15 | host/replicated_host_load_balancer.cxx 16 | host/petite_replicated_load_balancer.cxx 17 | host/fillin_replicated_load_balancer.cxx 18 | ) 19 | 20 | target_include_directories( gauxc 21 | PUBLIC 22 | $ 23 | ) 24 | 25 | if( GAUXC_HAS_DEVICE ) 26 | add_subdirectory( device ) 27 | endif() 28 | 29 | -------------------------------------------------------------------------------- /src/load_balancer/device/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE 9 | load_balancer_device_factory.cxx 10 | ) 11 | 12 | if( GAUXC_HAS_CUDA ) 13 | add_subdirectory( cuda ) 14 | endif() 15 | 16 | if( GAUXC_HAS_HIP ) 17 | add_subdirectory( hip ) 18 | endif() 19 | -------------------------------------------------------------------------------- /src/load_balancer/device/cuda/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE cuda_collision_detection.cu 9 | replicated_cuda_load_balancer.cxx ) 10 | -------------------------------------------------------------------------------- /src/load_balancer/device/cuda/replicated_cuda_load_balancer.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include "load_balancer_impl.hpp" 11 | 12 | namespace GauXC { 13 | namespace detail { 14 | 15 | class DeviceReplicatedLoadBalancer : public LoadBalancerImpl { 16 | 17 | protected: 18 | 19 | using basis_type = BasisSet; 20 | std::vector< XCTask > create_local_tasks_() const override; 21 | 22 | public: 23 | 24 | DeviceReplicatedLoadBalancer() = delete; 25 | template 26 | DeviceReplicatedLoadBalancer( Args&&... args ): 27 | LoadBalancerImpl( std::forward(args)... ) { } 28 | 29 | DeviceReplicatedLoadBalancer( const DeviceReplicatedLoadBalancer& ); 30 | DeviceReplicatedLoadBalancer( DeviceReplicatedLoadBalancer&& ) noexcept; 31 | 32 | virtual ~DeviceReplicatedLoadBalancer() noexcept; 33 | 34 | std::unique_ptr clone() const override; 35 | 36 | }; 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/load_balancer/device/hip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE hip_collision_detection.hip 9 | replicated_hip_load_balancer.cxx ) 10 | -------------------------------------------------------------------------------- /src/load_balancer/device/hip/replicated_hip_load_balancer.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include "load_balancer_impl.hpp" 11 | 12 | namespace GauXC { 13 | namespace detail { 14 | 15 | class DeviceReplicatedLoadBalancer : public LoadBalancerImpl { 16 | 17 | protected: 18 | 19 | using basis_type = BasisSet; 20 | std::vector< XCTask > create_local_tasks_() const override; 21 | 22 | public: 23 | 24 | DeviceReplicatedLoadBalancer() = delete; 25 | template 26 | DeviceReplicatedLoadBalancer( Args&&... args ): 27 | LoadBalancerImpl( std::forward(args)... ) { } 28 | 29 | DeviceReplicatedLoadBalancer( const DeviceReplicatedLoadBalancer& ); 30 | DeviceReplicatedLoadBalancer( DeviceReplicatedLoadBalancer&& ) noexcept; 31 | 32 | virtual ~DeviceReplicatedLoadBalancer() noexcept; 33 | 34 | std::unique_ptr clone() const override; 35 | 36 | }; 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/load_balancer/device/load_balancer_device_factory.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include 9 | 10 | namespace GauXC { 11 | 12 | struct LoadBalancerDeviceFactory { 13 | 14 | static std::shared_ptr get_shared_instance( 15 | std::string kernel_name, const RuntimeEnvironment& rt, 16 | const Molecule& mol, const MolGrid& mg, const BasisSet& basis 17 | ); 18 | 19 | }; 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/load_balancer/host/fillin_replicated_load_balancer.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "replicated_host_load_balancer.hpp" 10 | 11 | namespace GauXC { 12 | namespace detail { 13 | 14 | struct FillInHostReplicatedLoadBalancer : public HostReplicatedLoadBalancer { 15 | 16 | template 17 | FillInHostReplicatedLoadBalancer( Args&&... args ): 18 | HostReplicatedLoadBalancer( std::forward(args)... ) { } 19 | 20 | FillInHostReplicatedLoadBalancer( const FillInHostReplicatedLoadBalancer& ); 21 | FillInHostReplicatedLoadBalancer( FillInHostReplicatedLoadBalancer&& ) noexcept; 22 | 23 | ~FillInHostReplicatedLoadBalancer() noexcept; 24 | 25 | std::unique_ptr clone() const override final; 26 | 27 | std::pair< std::vector, size_t > micro_batch_screen( 28 | const BasisSet&, const std::array&, 29 | const std::array& ) const override final; 30 | 31 | }; 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/load_balancer/host/load_balancer_host_factory.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | 11 | namespace GauXC { 12 | 13 | struct LoadBalancerHostFactory { 14 | 15 | static std::shared_ptr get_shared_instance( 16 | std::string kernel_name, const RuntimeEnvironment& rt, 17 | const Molecule& mol, const MolGrid& mg, const BasisSet& basis 18 | ); 19 | 20 | }; 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/load_balancer/host/petite_replicated_load_balancer.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "replicated_host_load_balancer.hpp" 10 | 11 | namespace GauXC { 12 | namespace detail { 13 | 14 | struct PetiteHostReplicatedLoadBalancer : public HostReplicatedLoadBalancer { 15 | 16 | template 17 | PetiteHostReplicatedLoadBalancer( Args&&... args ): 18 | HostReplicatedLoadBalancer( std::forward(args)... ) { } 19 | 20 | PetiteHostReplicatedLoadBalancer( const PetiteHostReplicatedLoadBalancer& ); 21 | PetiteHostReplicatedLoadBalancer( PetiteHostReplicatedLoadBalancer&& ) noexcept; 22 | 23 | ~PetiteHostReplicatedLoadBalancer() noexcept; 24 | 25 | std::unique_ptr clone() const override final; 26 | 27 | std::pair< std::vector, size_t > micro_batch_screen( 28 | const BasisSet&, const std::array&, 29 | const std::array& ) const override final; 30 | 31 | }; 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/molecular_weights/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE molecular_weights.cxx ) 9 | add_subdirectory( host ) 10 | if(GAUXC_HAS_DEVICE) 11 | add_subdirectory( device ) 12 | endif() 13 | -------------------------------------------------------------------------------- /src/molecular_weights/device/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE device_molecular_weights.cxx ) 9 | -------------------------------------------------------------------------------- /src/molecular_weights/device/device_molecular_weights.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "../molecular_weights_impl.hpp" 10 | namespace GauXC::detail { 11 | 12 | class DeviceMolecularWeights : public MolecularWeightsImpl { 13 | 14 | public: 15 | 16 | DeviceMolecularWeights() = delete; 17 | virtual ~DeviceMolecularWeights() noexcept = default; 18 | DeviceMolecularWeights( const DeviceMolecularWeights& ) = delete; 19 | DeviceMolecularWeights( DeviceMolecularWeights&& ) noexcept = default; 20 | 21 | template 22 | inline DeviceMolecularWeights(Args&&... args) : 23 | MolecularWeightsImpl(std::forward(args)...) {} 24 | 25 | void modify_weights(LoadBalancer&) const final; 26 | 27 | }; 28 | 29 | template 30 | std::unique_ptr 31 | make_device_mol_weights_impl(Args&&... args) { 32 | return std::make_unique( 33 | std::forward(args)...); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/molecular_weights/host/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE host_molecular_weights.cxx ) 9 | -------------------------------------------------------------------------------- /src/molecular_weights/host/host_molecular_weights.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "../molecular_weights_impl.hpp" 10 | namespace GauXC::detail { 11 | 12 | class HostMolecularWeights : public MolecularWeightsImpl { 13 | 14 | public: 15 | 16 | HostMolecularWeights() = delete; 17 | virtual ~HostMolecularWeights() noexcept = default; 18 | HostMolecularWeights( const HostMolecularWeights& ) = delete; 19 | HostMolecularWeights( HostMolecularWeights&& ) noexcept = default; 20 | 21 | template 22 | inline HostMolecularWeights(Args&&... args) : 23 | MolecularWeightsImpl(std::forward(args)...) {} 24 | 25 | void modify_weights(LoadBalancer&) const final; 26 | 27 | }; 28 | 29 | template 30 | std::unique_ptr 31 | make_host_mol_weights_impl(Args&&... args) { 32 | return std::make_unique( 33 | std::forward(args)...); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/molgrid.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "molgrid_impl.hpp" 9 | #include 10 | 11 | namespace GauXC { 12 | 13 | MolGrid::MolGrid( const atomic_grid_map& ag ) : 14 | pimpl_( std::make_shared( ag ) ) { } 15 | 16 | MolGrid::MolGrid( const MolGrid& ) = default; 17 | MolGrid::MolGrid( MolGrid&& ) noexcept = default; 18 | MolGrid::~MolGrid() noexcept = default; 19 | 20 | size_t MolGrid::natoms_uniq() const { return pimpl_->natoms_uniq(); } 21 | 22 | const Grid& MolGrid::get_grid( AtomicNumber Z ) const { 23 | return pimpl_->get_grid(Z); 24 | } 25 | Grid& MolGrid::get_grid( AtomicNumber Z ) { 26 | return pimpl_->get_grid(Z); 27 | } 28 | 29 | size_t MolGrid::max_nbatches() const { 30 | return pimpl_->max_nbatches(); 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/molgrid_impl.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace GauXC { 13 | namespace detail { 14 | 15 | class MolGridImpl { 16 | 17 | atomic_grid_map molgrid_; 18 | 19 | public: 20 | 21 | MolGridImpl( const atomic_grid_map& ); 22 | 23 | MolGridImpl( const MolGridImpl& ); 24 | MolGridImpl( MolGridImpl&& ) noexcept; 25 | 26 | ~MolGridImpl() noexcept; 27 | 28 | size_t natoms_uniq() const; 29 | const Grid& get_grid( AtomicNumber ) const; 30 | Grid& get_grid( AtomicNumber ) ; 31 | 32 | size_t max_nbatches() const; 33 | 34 | }; 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/reduction_driver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE 9 | reduction_driver.cxx 10 | reduction_driver_factory.cxx 11 | reduction_driver_impl.cxx 12 | ) 13 | 14 | 15 | target_include_directories( gauxc 16 | PUBLIC 17 | $ 18 | ) 19 | 20 | add_subdirectory(host) 21 | if( GAUXC_HAS_DEVICE ) 22 | add_subdirectory(device) 23 | endif() 24 | -------------------------------------------------------------------------------- /src/reduction_driver/device/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE 9 | device_reduction_driver.cxx 10 | ) 11 | 12 | if( GAUXC_ENABLE_NCCL ) 13 | target_sources( gauxc PRIVATE nccl_reduction_driver.cxx ) 14 | message( STATUS "NCCL Has Been Enabled" ) 15 | find_package( NCCL REQUIRED ) 16 | target_link_libraries( gauxc PUBLIC NCCL::nccl ) 17 | set(GAUXC_HAS_NCCL TRUE CACHE BOOL "GauXC has NCCL" FORCE) 18 | endif() 19 | 20 | -------------------------------------------------------------------------------- /src/reduction_driver/device/device_reduction_driver.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "device_reduction_driver.hpp" 9 | 10 | namespace GauXC { 11 | 12 | DeviceReductionDriver::DeviceReductionDriver(const RuntimeEnvironment& rt) : 13 | detail::ReductionDriverImpl(rt) { } 14 | 15 | 16 | DeviceReductionDriver::~DeviceReductionDriver() noexcept = default; 17 | 18 | 19 | 20 | bool DeviceReductionDriver::takes_host_memory() const {return false;}; 21 | bool DeviceReductionDriver::takes_device_memory() const {return true;}; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/reduction_driver/device/device_reduction_driver.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "reduction_driver_impl.hpp" 10 | 11 | 12 | namespace GauXC { 13 | 14 | struct DeviceReductionDriver : public detail::ReductionDriverImpl { 15 | 16 | bool takes_host_memory() const override; 17 | bool takes_device_memory() const override; 18 | 19 | virtual ~DeviceReductionDriver() noexcept; 20 | 21 | DeviceReductionDriver(const RuntimeEnvironment& rt); 22 | 23 | }; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/reduction_driver/host/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE 9 | basic_mpi_reduction_driver.cxx 10 | host_reduction_driver.cxx 11 | ) 12 | -------------------------------------------------------------------------------- /src/reduction_driver/host/basic_mpi_reduction_driver.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "host_reduction_driver.hpp" 10 | 11 | namespace GauXC { 12 | 13 | struct BasicMPIReductionDriver : public HostReductionDriver { 14 | 15 | BasicMPIReductionDriver(const RuntimeEnvironment& rt); 16 | virtual ~BasicMPIReductionDriver() noexcept; 17 | BasicMPIReductionDriver(const BasicMPIReductionDriver& ); 18 | 19 | void allreduce_typeerased( const void*, void*, size_t, ReductionOp, std::type_index, std::any ) override; 20 | void allreduce_inplace_typeerased( void*, size_t, ReductionOp, std::type_index, std::any ) override; 21 | 22 | std::unique_ptr clone() override; 23 | 24 | }; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/reduction_driver/host/host_reduction_driver.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "host_reduction_driver.hpp" 9 | 10 | namespace GauXC { 11 | 12 | HostReductionDriver::HostReductionDriver(const RuntimeEnvironment& rt) : 13 | detail::ReductionDriverImpl(rt) { } 14 | 15 | 16 | HostReductionDriver::~HostReductionDriver() noexcept = default; 17 | 18 | 19 | 20 | bool HostReductionDriver::takes_host_memory() const {return true;}; 21 | bool HostReductionDriver::takes_device_memory() const {return false;}; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/reduction_driver/host/host_reduction_driver.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "reduction_driver_impl.hpp" 10 | 11 | 12 | namespace GauXC { 13 | 14 | struct HostReductionDriver : public detail::ReductionDriverImpl { 15 | 16 | bool takes_host_memory() const override; 17 | bool takes_device_memory() const override; 18 | 19 | virtual ~HostReductionDriver() noexcept; 20 | 21 | HostReductionDriver(const RuntimeEnvironment& rt); 22 | 23 | }; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/reduction_driver/reduction_driver_impl.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "reduction_driver_impl.hpp" 9 | 10 | namespace GauXC::detail { 11 | 12 | 13 | ReductionDriverImpl::ReductionDriverImpl( const RuntimeEnvironment& rt ) 14 | : runtime_(rt){} 15 | 16 | ReductionDriverImpl::~ReductionDriverImpl() noexcept = default; 17 | ReductionDriverImpl::ReductionDriverImpl(const ReductionDriverImpl& ) = default; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/reduction_driver/reduction_driver_impl.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | 11 | namespace GauXC { 12 | namespace detail { 13 | 14 | class ReductionDriverImpl { 15 | 16 | protected: 17 | 18 | const RuntimeEnvironment& runtime_; 19 | 20 | public: 21 | 22 | ReductionDriverImpl() = delete; 23 | ReductionDriverImpl( const RuntimeEnvironment& rt); 24 | 25 | virtual ~ReductionDriverImpl() noexcept; 26 | ReductionDriverImpl( const ReductionDriverImpl& ); 27 | 28 | virtual void allreduce_typeerased( const void*, void*, size_t, ReductionOp, std::type_index, std::any ) = 0; 29 | virtual void allreduce_inplace_typeerased( void*, size_t, ReductionOp, std::type_index, std::any ) = 0; 30 | 31 | virtual bool takes_host_memory() const = 0; 32 | virtual bool takes_device_memory() const = 0; 33 | 34 | virtual std::unique_ptr clone() = 0; 35 | }; 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/runtime_environment/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE runtime_environment.cxx ) 9 | target_include_directories( gauxc 10 | PUBLIC 11 | $ 12 | ) 13 | if(GAUXC_HAS_DEVICE) 14 | add_subdirectory(device) 15 | endif() 16 | -------------------------------------------------------------------------------- /src/runtime_environment/device/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE device_runtime_environment.cxx ) 9 | if(GAUXC_ENABLE_CUDA) 10 | add_subdirectory( cuda ) 11 | endif() 12 | 13 | if(GAUXC_ENABLE_HIP) 14 | add_subdirectory( hip ) 15 | endif() 16 | 17 | -------------------------------------------------------------------------------- /src/runtime_environment/device/cuda/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | if( NOT TARGET CUDA::cublas ) 9 | find_package( CUDAToolkit REQUIRED ) 10 | endif() 11 | 12 | target_compile_features( gauxc PRIVATE cuda_std_14 ) 13 | target_sources( gauxc PRIVATE cuda_backend.cxx ) 14 | 15 | if(NOT GAUXC_LINK_CUDA_STATIC) 16 | target_link_libraries( gauxc PUBLIC CUDA::cudart CUDA::cublas ) 17 | else() 18 | target_link_libraries( gauxc PUBLIC CUDA::cudart_static CUDA::cublas_static ) 19 | endif() 20 | -------------------------------------------------------------------------------- /src/runtime_environment/device/hip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | 9 | find_package( hip REQUIRED ) 10 | find_package( hipblas REQUIRED ) 11 | 12 | target_sources( gauxc PRIVATE hip_backend.cxx ) 13 | target_link_libraries( gauxc PUBLIC hip::host roc::hipblas ) 14 | -------------------------------------------------------------------------------- /src/runtime_environment/device_specific/cuda_device_constants.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | 11 | namespace GauXC { 12 | namespace cuda { 13 | 14 | static constexpr uint32_t warp_size = 32; 15 | static constexpr uint32_t max_threads_per_thread_block = 1024; 16 | static constexpr uint32_t max_warps_per_thread_block = 17 | max_threads_per_thread_block / warp_size; 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/runtime_environment/device_specific/hip_device_constants.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | 11 | namespace GauXC { 12 | namespace hip { 13 | 14 | static constexpr uint32_t warp_size = 64; 15 | static constexpr uint32_t max_threads_per_thread_block = 1024; 16 | static constexpr uint32_t max_warps_per_thread_block = 17 | max_threads_per_thread_block / warp_size; 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/runtime_environment/runtime_environment_impl.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | 11 | namespace GauXC::detail { 12 | 13 | class RuntimeEnvironmentImpl { 14 | 15 | protected: 16 | GAUXC_MPI_CODE(MPI_Comm comm_;) 17 | int comm_rank_; 18 | int comm_size_; 19 | 20 | public: 21 | 22 | explicit RuntimeEnvironmentImpl(GAUXC_MPI_CODE(MPI_Comm c)) : 23 | GAUXC_MPI_CODE(comm_(c),) 24 | comm_rank_(0), comm_size_(1) { 25 | 26 | #ifdef GAUXC_HAS_MPI 27 | MPI_Comm_rank( comm_, &comm_rank_ ); 28 | MPI_Comm_size( comm_, &comm_size_ ); 29 | #endif 30 | 31 | } 32 | 33 | virtual ~RuntimeEnvironmentImpl() noexcept = default; 34 | 35 | #ifdef GAUXC_HAS_MPI 36 | inline MPI_Comm comm() const { return comm_; } 37 | #endif 38 | 39 | inline int comm_rank() const { return comm_rank_; } 40 | inline int comm_size() const { return comm_size_; } 41 | 42 | }; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/xc_integrator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | add_subdirectory(integrator_util) 9 | add_subdirectory(local_work_driver) 10 | add_subdirectory(shell_batched) 11 | add_subdirectory(replicated) 12 | add_subdirectory(xc_data) 13 | 14 | target_include_directories( gauxc 15 | PUBLIC 16 | $ 17 | ) 18 | -------------------------------------------------------------------------------- /src/xc_integrator/integrator_util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE integrator_common.cxx integral_bounds.cxx exx_screening.cxx ) 9 | -------------------------------------------------------------------------------- /src/xc_integrator/integrator_util/integral_bounds.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace GauXC { 13 | namespace util { 14 | 15 | template 16 | T max_coulomb( const Shell& bra, const Shell& ket); 17 | 18 | extern template double max_coulomb( const Shell&, const Shell& ); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/xc_integrator/integrator_util/integrator_common.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace GauXC { 13 | 14 | std::tuple< std::vector< std::array >, std::vector< int32_t > > 15 | gen_compressed_submat_map( const BasisSetMap& basis_set, 16 | const std::vector< int32_t >& shell_mask, 17 | const int32_t LDA, const int32_t block_size ); 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | add_subdirectory(host) 9 | if(GAUXC_HAS_DEVICE) 10 | add_subdirectory(device) 11 | endif() 12 | 13 | target_sources( gauxc PRIVATE factory.cxx ) 14 | target_include_directories( gauxc 15 | PUBLIC 16 | $ 17 | ) 18 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/common/integrator_constants.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | namespace GauXC { 11 | namespace integrator { 12 | 13 | template 14 | constexpr F magic_ssf_factor = 0.64; 15 | 16 | constexpr double ssf_weight_tol = 1e-10; 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE 9 | local_device_work_driver.cxx 10 | local_device_work_driver_pimpl.cxx 11 | 12 | scheme1_base.cxx 13 | scheme1_data_base.cxx 14 | ) 15 | 16 | if( GAUXC_ENABLE_MAGMA ) 17 | find_package( MAGMA REQUIRED ) 18 | target_link_libraries( gauxc PUBLIC MAGMA::magma ) 19 | set(GAUXC_HAS_MAGMA TRUE CACHE BOOL "GauXC has MAGMA" FORCE) 20 | 21 | target_sources( gauxc PRIVATE 22 | scheme1_magma_base.cxx 23 | scheme1_magma_data_base.cxx 24 | ) 25 | endif() 26 | 27 | if(GAUXC_HAS_CUDA) 28 | add_subdirectory( cuda ) 29 | endif() 30 | 31 | if(GAUXC_HAS_HIP) 32 | add_subdirectory( hip ) 33 | endif() 34 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/common/inc_potential.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "device/xc_device_task.hpp" 10 | #include "device/device_queue.hpp" 11 | 12 | namespace GauXC { 13 | 14 | void sym_task_inc_potential( size_t ntasks, 15 | XCDeviceTask* device_tasks, 16 | double* V_device, 17 | size_t LDV, 18 | size_t submat_block, 19 | device_queue queue ); 20 | 21 | void asym_task_inc_potential( size_t ntasks, 22 | XCDeviceTask* device_tasks, 23 | double* V_device, 24 | size_t LDV, 25 | size_t submat_block, 26 | device_queue queue ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/common/increment_exc_grad.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | #include "device/xc_device_task.hpp" 11 | #include "device/device_queue.hpp" 12 | #include "shell_to_task.hpp" 13 | 14 | namespace GauXC { 15 | 16 | void increment_exc_grad_lda( size_t nshell, ShellToTaskDevice* shell_to_task, 17 | XCDeviceTask* device_tasks, double* EXC_GRAD, device_queue ); 18 | void increment_exc_grad_gga( size_t nshell, ShellToTaskDevice* shell_to_task, 19 | XCDeviceTask* device_tasks, double* EXC_GRAD, device_queue ); 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/common/pack_submat.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "device/xc_device_task.hpp" 9 | #include "device/device_queue.hpp" 10 | 11 | namespace GauXC { 12 | 13 | void sym_pack_submat( size_t ntasks, XCDeviceTask* device_tasks, const double* A, 14 | int32_t LDA, int32_t submat_block_size, device_queue queue ); 15 | 16 | void asym_pack_submat( size_t ntasks, XCDeviceTask* device_tasks, const double* A, 17 | int32_t LDA, int32_t submat_block_size, device_queue queue ); 18 | } 19 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/common/shell_to_task.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | 11 | namespace GauXC { 12 | 13 | struct ShellToTaskDevice { 14 | int32_t ntask; 15 | int32_t center_idx; 16 | int32_t true_idx; 17 | int32_t* task_idx_device; 18 | int32_t* task_shell_offs_device; 19 | Shell* shell_device; 20 | }; 21 | 22 | struct AngularMomentumShellToTaskBatch { 23 | size_t ntask_average; 24 | size_t npts_average; 25 | size_t nshells_in_batch; 26 | ShellToTaskDevice* shell_to_task_device; 27 | uint32_t pure; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/common/symmetrize_mat.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "device/device_queue.hpp" 10 | 11 | namespace GauXC { 12 | 13 | void symmetrize_matrix( int32_t N, double* A, size_t LDA, device_queue queue ); 14 | void symmetrize_matrix_inc( int32_t N, double* A, size_t LDA, device_queue queue ); 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/common/uvvars.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "device/xc_device_task.hpp" 10 | #include "device/xc_device_data.hpp" 11 | #include "device/device_queue.hpp" 12 | 13 | namespace GauXC { 14 | 15 | 16 | void eval_uvars_lda( size_t ntasks, int32_t npts_max, integrator_ks_scheme ks_scheme, 17 | XCDeviceTask* device_tasks, device_queue queue ); 18 | 19 | void eval_uvars_gga( size_t ntasks, int32_t npts_max, integrator_ks_scheme ks_scheme, 20 | XCDeviceTask* device_tasks, device_queue queue ); 21 | 22 | void eval_uvars_mgga( size_t ntasks, size_t npts_total, int32_t nbf_max, 23 | int32_t npts_max, bool do_lapl, XCDeviceTask* device_tasks, 24 | device_queue queue ); 25 | 26 | void eval_vvar( size_t ntasks, int32_t nbf_max, int32_t npts_max, bool do_grad, density_id den_select, 27 | XCDeviceTask* device_tasks, device_queue queue ); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/common/xc_functional_eval_wrapper.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | #include "device/device_queue.hpp" 11 | 12 | namespace GauXC { 13 | 14 | void eval_kern_exc_vxc_lda( const functional_type& func, size_t npts, 15 | const double* rho, double* eps, double* vrho, device_queue queue ); 16 | void eval_kern_exc_vxc_gga( const functional_type& func, size_t npts, 17 | const double* rho, const double* gamma, double* eps, double* vrho, 18 | double* vgamma, device_queue queue ); 19 | void eval_kern_exc_vxc_mgga( const functional_type& func, size_t npts, 20 | const double* rho, const double* gamma, const double* tau, const double* lapl, 21 | double* eps, double* vrho, double* vgamma, double* vtau, double* vlapl, 22 | device_queue queue ); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/cuda_aos_scheme1_weights.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | namespace GauXC { 9 | 10 | void cuda_aos_scheme1_weights_wrapper( int32_t npts, int32_t natoms, 11 | const double* points_x, const double* points_y, const double* points_z, 12 | const double* RAB, int32_t ldRAB, const double* coords, 13 | double* dist, int32_t lddist, const int32_t* iparent, 14 | const double* dist_nearest, double* weights, cudaStream_t stream ); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/kernels/collocation/collocation_device_constants.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | namespace GauXC { 11 | 12 | constexpr double sqrt_3 = 1.7320508075688772; 13 | constexpr double sqrt_5 = 2.23606797749979; 14 | constexpr double sqrt_15 = 3.872983346207417; 15 | constexpr double sqrt_10 = 3.1622776601683795; 16 | constexpr double sqrt_6 = 2.449489742783178; 17 | constexpr double sqrt_35 = 5.916079783099616; 18 | constexpr double sqrt_70 = 8.366600265340756; 19 | 20 | } // namespace GauXC 21 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/kernels/collocation/scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/src/xc_integrator/local_work_driver/device/cuda/kernels/collocation/scripts/__init__.py -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/kernels/collocation/templates/collocation_device_constants_template.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | namespace GauXC { 11 | 12 | $for( x in const_lines )\ 13 | $(x) 14 | $endfor\ 15 | 16 | } // namespace GauXC 17 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/kernels/cuda_extensions.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | 11 | namespace GauXC { 12 | namespace cuda { 13 | 14 | template 15 | __device__ T warp_reduce_sum(T val) { 16 | 17 | for(int i=(warp_sz/2); i>=1; i/=2) 18 | val += __shfl_xor_sync(0xffffffff, val, i, warp_sz); 19 | 20 | return val; 21 | } 22 | 23 | template 24 | __device__ T warp_reduce_prod(T val) { 25 | 26 | for(int i=(warp_sz/2); i>=1; i/=2) 27 | val *= __shfl_xor_sync(0xffffffff, val, i, warp_sz); 28 | 29 | return val; 30 | } 31 | 32 | template 33 | __device__ T warp_reduce_max(T val) { 34 | 35 | for(int i=(warp_sz/2); i>=1; i/=2) 36 | val = fmax( val, __shfl_xor_sync(0xffffffff, val, i, warp_sz) ); 37 | 38 | return val; 39 | } 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/kernels/cuda_ssf_1d.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | 9 | namespace GauXC { 10 | 11 | void partition_weights_ssf_1d( int32_t npts, int32_t natoms, const double* RAB, 12 | int32_t ldRAB, const double* coords, const double* dist, int32_t lddist, 13 | const int32_t* iparent, const double* dist_nearest, double* weights, 14 | cudaStream_t stream); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/kernels/grid_to_center.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | namespace GauXC { 11 | 12 | void compute_grid_to_center_dist( int32_t npts, int32_t natoms, 13 | const double* coords, const double* points_x, const double* points_y, 14 | const double* points_z, double* dist, int32_t lddist, cudaStream_t stream ); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/obara_saika/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | set( GAUXC_OBARA_SAIKA_CUDA_SRC 9 | src/integral_0.cu 10 | src/integral_1.cu 11 | src/integral_2.cu 12 | src/integral_0_0.cu 13 | src/integral_1_0.cu 14 | src/integral_1_1.cu 15 | src/integral_2_0.cu 16 | src/integral_2_1.cu 17 | src/integral_2_2.cu 18 | src/obara_saika_integrals.cu 19 | src/chebyshev_boys_computation.cu 20 | ) 21 | target_sources( gauxc PRIVATE ${GAUXC_OBARA_SAIKA_CUDA_SRC} ) 22 | target_include_directories( gauxc PUBLIC 23 | $ 24 | ) 25 | 26 | #add_executable( cuda_obara_saika_test test/test_new.cpp ) 27 | #target_link_libraries( cuda_obara_saika_test PUBLIC gauxc ) 28 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/obara_saika/generator/Makefile: -------------------------------------------------------------------------------- 1 | compile: 2 | gcc -Wall -o generate_gpu_code.x generate_gpu_code.c -O2 3 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/obara_saika/include/gpu/chebyshev_boys_computation.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | #define DEFAULT_NCHEB 7 13 | #define DEFAULT_MAX_M 8 14 | #define DEFAULT_MAX_T 30 15 | 16 | #define DEFAULT_NSEGMENT ((DEFAULT_MAX_T * DEFAULT_NCHEB) / 2) 17 | #define DEFAULT_LD_TABLE (DEFAULT_NCHEB + 1) 18 | 19 | namespace XGPU { 20 | // create tables 21 | double *boys_init(); 22 | void boys_finalize(double *boys_table); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/obara_saika/include/gpu/integral_data_types.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | #include 11 | #include 12 | #include "device/xc_device_task.hpp" 13 | #include "device/common/shell_pair_to_task.hpp" 14 | 15 | namespace XGPU { 16 | 17 | //typedef struct { 18 | // double x, y, z; 19 | //} point; 20 | using point = GauXC::detail::cartesian_point; 21 | 22 | typedef struct { 23 | double alpha, coeff; 24 | } coefficients; 25 | 26 | typedef struct { 27 | point origin; 28 | coefficients *coeff; 29 | int m, L; 30 | } shells; 31 | 32 | #if 0 33 | typedef struct { 34 | point P; 35 | point PA; 36 | point PB; 37 | 38 | double K_coeff_prod; 39 | double gamma; 40 | double gamma_inv; 41 | } prim_pair; 42 | #else 43 | using prim_pair = GauXC::PrimitivePair; 44 | using shell_pair = GauXC::ShellPair; 45 | #endif 46 | 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/obara_saika/src/integral_0.hu: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include "../include/gpu/integral_data_types.hpp" 11 | namespace XGPU { 12 | void integral_0(size_t npts, 13 | double *points_x, 14 | double *points_y, 15 | double *points_z, 16 | const int nprim_pairs, 17 | const GauXC::PrimitivePair* prim_pairs, 18 | double *Xi, 19 | int ldX, 20 | double *Gi, 21 | int ldG, 22 | double *weights, 23 | double *boys_table, 24 | cudaStream_t stream); 25 | 26 | void integral_0_batched(size_t ntask_sp, 27 | const GauXC::ShellPairToTaskDevice* sp2task, 28 | GauXC::XCDeviceTask* device_tasks, 29 | double *boys_table, 30 | cudaStream_t stream); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/obara_saika/src/integral_1.hu: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include "../include/gpu/integral_data_types.hpp" 11 | namespace XGPU { 12 | void integral_1(size_t npts, 13 | double *points_x, 14 | double *points_y, 15 | double *points_z, 16 | const int nprim_pairs, 17 | const GauXC::PrimitivePair* prim_pairs, 18 | double *Xi, 19 | int ldX, 20 | double *Gi, 21 | int ldG, 22 | double *weights, 23 | double *boys_table, 24 | cudaStream_t stream); 25 | 26 | void integral_1_batched(size_t ntask_sp, 27 | const GauXC::ShellPairToTaskDevice* sp2task, 28 | GauXC::XCDeviceTask* device_tasks, 29 | double *boys_table, 30 | cudaStream_t stream); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/obara_saika/src/integral_2.hu: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include "../include/gpu/integral_data_types.hpp" 11 | namespace XGPU { 12 | void integral_2(size_t npts, 13 | double *points_x, 14 | double *points_y, 15 | double *points_z, 16 | const int nprim_pairs, 17 | const GauXC::PrimitivePair* prim_pairs, 18 | double *Xi, 19 | int ldX, 20 | double *Gi, 21 | int ldG, 22 | double *weights, 23 | double *boys_table, 24 | cudaStream_t stream); 25 | 26 | void integral_2_batched(size_t ntask_sp, 27 | const GauXC::ShellPairToTaskDevice* sp2task, 28 | GauXC::XCDeviceTask* device_tasks, 29 | double *boys_table, 30 | cudaStream_t stream); 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/cuda/obara_saika/test/Makefile: -------------------------------------------------------------------------------- 1 | #LIBINT_ROOT = /global/cfs/cdirs/m1027/dbwy/mpqc4/li/install/haswell/release 2 | #EIGEN_DIR = /global/common/sw/cray/cnl7/haswell/eigen/3.3.7/gcc/8.2.0/2wwrykb/include/eigen3 3 | 4 | CPU_CC = CC 5 | CC = g++ 6 | 7 | #CONST_LIB = ../../../../../../include/ 8 | #LIBINT_ROOT = /home/dtpopovici/Executables/libint 9 | #EIGEN_DIR = /usr/local/include/eigen3 10 | 11 | CONST_LIB = ../../../../../../include/ 12 | LIBINT_ROOT = /global/homes/t/thom13/Executables/libint_gnu/ 13 | EIGEN_DIR = /global/homes/t/thom13/Executables/Eigen/include/eigen3/ 14 | 15 | compile: 16 | $(CC) test.cpp ../obara_saika.a $(LIBINT_ROOT)/lib/libint2.a -o test.x -I$(CONST_LIB) -I$(LIBINT_ROOT)/include -I$(EIGEN_DIR) -I../include/ -std=c++17 -I/usr/common/software/sles15_cgpu/cuda/11.1.1/include/ -L/usr/common/software/sles15_cgpu/cuda/11.1.1/lib64/ -lcudart -lcudadevrt 17 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/hip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources(gauxc PRIVATE 9 | hip_aos_scheme1_data.cxx 10 | hip_aos_scheme1.cxx 11 | 12 | xc_functional_eval_wrapper.cxx 13 | 14 | kernels/collocation_device.hip 15 | kernels/grid_to_center.hip 16 | kernels/hip_ssf_1d.hip 17 | kernels/hip_ssh_2d.hip 18 | #cuda_aos_scheme1_weights.cu # cuda_ssf_2d w/ CudaAoSScheme1 constants 19 | kernels/pack_submat.hip 20 | kernels/hipblas_extensions.hip 21 | kernels/uvvars.hip 22 | kernels/zmat_vxc.hip 23 | kernels/hip_inc_potential.hip 24 | kernels/symmetrize_mat.hip 25 | 26 | ) 27 | 28 | if(GAUXC_HAS_MAGMA) 29 | # MAGMA requires linkage to hipSPARSE for some strange reason.... 30 | find_package( hipsparse REQUIRED ) 31 | target_link_libraries( gauxc PUBLIC roc::hipsparse ) 32 | endif() 33 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/hip/kernels/collocation/collocation_device_constants.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | namespace GauXC { 11 | 12 | constexpr double sqrt_15 = 3.872983346207417; 13 | constexpr double sqrt_3 = 1.7320508075688772; 14 | constexpr double sqrt_6 = 2.449489742783178; 15 | constexpr double sqrt_10 = 3.1622776601683795; 16 | 17 | } // namespace GauXC 18 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/hip/kernels/collocation/collocation_spherical_unnorm.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | 9 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/hip/kernels/grid_to_center.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | namespace GauXC { 11 | 12 | void compute_grid_to_center_dist( int32_t npts, int32_t natoms, 13 | const double* coords, const double* points_x, const double* points_y, 14 | const double* points_z, double* dist, int32_t lddist, hipStream_t stream ); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/hip/kernels/hip_ssf_1d.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | 9 | namespace GauXC { 10 | 11 | void partition_weights_ssf_1d( int32_t npts, int32_t natoms, const double* RAB, 12 | int32_t ldRAB, const double* coords, const double* dist, int32_t lddist, 13 | const int32_t* iparent, const double* dist_nearest, double* weights, 14 | hipStream_t stream); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/hip/kernels/hip_ssh_2d.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | 9 | namespace GauXC { 10 | 11 | void partition_weights_ssf_2d( int32_t npts, int32_t natoms, const double* RAB, 12 | int32_t ldRAB, const double* coords, const double* dist, int32_t lddist, 13 | const int32_t* iparent, const double* dist_nearest, double* weights, 14 | hipStream_t stream); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/hip/xc_functional_eval_wrapper.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "device/common/xc_functional_eval_wrapper.hpp" 9 | #include "device_specific/hip_util.hpp" 10 | 11 | namespace GauXC { 12 | 13 | void eval_kern_exc_vxc_lda( const functional_type& func, size_t npts, 14 | const double* rho, double* eps, double* vrho, device_queue queue ) { 15 | 16 | hipStream_t stream = queue.queue_as(); 17 | func.eval_exc_vxc_device( npts, rho, eps, vrho, stream ); 18 | 19 | } 20 | 21 | void eval_kern_exc_vxc_gga( const functional_type& func, size_t npts, 22 | const double* rho, const double* gamma, double* eps, double* vrho, 23 | double* vgamma, device_queue queue ) { 24 | 25 | hipStream_t stream = queue.queue_as(); 26 | func.eval_exc_vxc_device( npts, rho, gamma, eps, vrho, vgamma, stream ); 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/device/local_device_work_driver_pimpl.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "local_device_work_driver_pimpl.hpp" 9 | 10 | namespace GauXC::detail { 11 | 12 | LocalDeviceWorkDriverPIMPL::LocalDeviceWorkDriverPIMPL() = default; 13 | LocalDeviceWorkDriverPIMPL::~LocalDeviceWorkDriverPIMPL() noexcept = default; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/blas.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | 11 | namespace GauXC::blas { 12 | 13 | template 14 | void lacpy( char UPLO, int M, int N, const T* A, int LDA, T* B, 15 | int LDB ); 16 | 17 | template 18 | void gemm( char TA, char TB, int M, int N, int K, T ALPHA, 19 | const T* A, int LDA, const T* B, int LDB, T BETA, 20 | T* C, int LDC ); 21 | 22 | template 23 | void syr2k( char UPLO, char TRANS, int N, int K, T ALPHA, 24 | const T* A, int LDA, const T* B, int LDB, T BETA, 25 | T* C, int LDC ); 26 | 27 | 28 | template 29 | T dot( int N, const T* X, int INCX, const T* Y, int INCY ); 30 | 31 | template 32 | void axpy( int N, T ALPHA, const T* X, int INCX, T* Y, int INCY ); 33 | 34 | template 35 | void scal( int N, T ALPHA, T* X, int INCX ); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/local_host_work_driver_pimpl.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "local_host_work_driver_pimpl.hpp" 9 | 10 | namespace GauXC::detail { 11 | 12 | LocalHostWorkDriverPIMPL::LocalHostWorkDriverPIMPL() = default; 13 | LocalHostWorkDriverPIMPL::~LocalHostWorkDriverPIMPL() noexcept = default; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | set( GAUXC_OBARA_SAIKA_HOST_SRC 9 | src/integral_0.cxx 10 | src/integral_1.cxx 11 | src/integral_2.cxx 12 | src/integral_3.cxx 13 | src/integral_4.cxx 14 | src/integral_0_0.cxx 15 | src/integral_1_0.cxx 16 | src/integral_1_1.cxx 17 | src/integral_2_0.cxx 18 | src/integral_2_1.cxx 19 | src/integral_2_2.cxx 20 | src/integral_3_0.cxx 21 | src/integral_3_1.cxx 22 | src/integral_3_2.cxx 23 | src/integral_3_3.cxx 24 | src/integral_4_0.cxx 25 | src/integral_4_1.cxx 26 | src/integral_4_2.cxx 27 | src/integral_4_3.cxx 28 | src/integral_4_4.cxx 29 | src/obara_saika_integrals.cxx 30 | src/chebyshev_boys_computation.cxx 31 | ) 32 | target_sources( gauxc PRIVATE ${GAUXC_OBARA_SAIKA_HOST_SRC} ) 33 | target_include_directories( gauxc PUBLIC 34 | $ 35 | ) 36 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/generator/Makefile: -------------------------------------------------------------------------------- 1 | compile: 2 | gcc -Wall -o generate_cpu_code.x generate_cpu_code.c -O2 3 | # gcc -Wall -o generate_gpu_code.x generate_gpu_code.c -O2 4 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/include/cpu/chebyshev_boys_computation.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | #include 11 | 12 | #define DEFAULT_NCHEB 7 13 | #define DEFAULT_MAX_M 8 14 | #define DEFAULT_MAX_T 30 15 | 16 | #define DEFAULT_NSEGMENT ((DEFAULT_MAX_T * DEFAULT_NCHEB) / 2) 17 | #define DEFAULT_LD_TABLE (DEFAULT_NCHEB + 1) 18 | 19 | namespace XCPU { 20 | // create tables 21 | double *boys_init(); 22 | void boys_finalize(double *boys_table); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/include/cpu/integral_data_types.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | #include 11 | 12 | namespace XCPU { 13 | 14 | typedef struct { 15 | double x, y, z; 16 | } point; 17 | 18 | typedef struct { 19 | double alpha, coeff; 20 | } coefficients; 21 | 22 | typedef struct { 23 | point origin; 24 | coefficients *coeff; 25 | int m, L; 26 | } shells; 27 | 28 | #if 0 29 | typedef struct { 30 | point P; 31 | point PA; 32 | point PB; 33 | 34 | double K_coeff_prod; 35 | double gamma; 36 | double gamma_inv; 37 | } prim_pair; 38 | #else 39 | using prim_pair = GauXC::PrimitivePair; 40 | #endif 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/include/cpu/obara_saika_integrals.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | 10 | namespace XCPU { 11 | void generate_shell_pair( const shells& A, const shells& B, prim_pair *prim_pairs); 12 | void compute_integral_shell_pair(int is_diag, 13 | size_t npts, 14 | double *points, 15 | int lA, 16 | int lB, 17 | point rA, 18 | point rB, 19 | int nprim_pairs, 20 | prim_pair *prim_pairs, 21 | double *Xi, 22 | double *Xj, 23 | int ldX, 24 | double *Gi, 25 | double *Gj, 26 | int ldG, 27 | double *weights, 28 | double *boys_table); 29 | } 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_0.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_0 9 | #define __MY_INTEGRAL_0 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_0(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | int ldX, 21 | double *Gi, 22 | int ldG, 23 | double *weights, 24 | double *boys_table); 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_0_0.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_0_0 9 | #define __MY_INTEGRAL_0_0 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_0_0(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_1.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_1 9 | #define __MY_INTEGRAL_1 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_1(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | int ldX, 21 | double *Gi, 22 | int ldG, 23 | double *weights, 24 | double *boys_table); 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_1_0.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_1_0 9 | #define __MY_INTEGRAL_1_0 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_1_0(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_1_1.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_1_1 9 | #define __MY_INTEGRAL_1_1 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_1_1(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_2.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_2 9 | #define __MY_INTEGRAL_2 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_2(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | int ldX, 21 | double *Gi, 22 | int ldG, 23 | double *weights, 24 | double *boys_table); 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_2_0.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_2_0 9 | #define __MY_INTEGRAL_2_0 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_2_0(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_2_1.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_2_1 9 | #define __MY_INTEGRAL_2_1 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_2_1(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_2_2.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_2_2 9 | #define __MY_INTEGRAL_2_2 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_2_2(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_3.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_3 9 | #define __MY_INTEGRAL_3 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_3(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | int ldX, 21 | double *Gi, 22 | int ldG, 23 | double *weights, 24 | double *boys_table); 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_3_0.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_3_0 9 | #define __MY_INTEGRAL_3_0 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_3_0(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_3_1.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_3_1 9 | #define __MY_INTEGRAL_3_1 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_3_1(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_3_2.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_3_2 9 | #define __MY_INTEGRAL_3_2 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_3_2(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_3_3.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_3_3 9 | #define __MY_INTEGRAL_3_3 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_3_3(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_4.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_4 9 | #define __MY_INTEGRAL_4 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_4(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | int ldX, 21 | double *Gi, 22 | int ldG, 23 | double *weights, 24 | double *boys_table); 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_4_0.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_4_0 9 | #define __MY_INTEGRAL_4_0 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_4_0(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_4_1.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_4_1 9 | #define __MY_INTEGRAL_4_1 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_4_1(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_4_2.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_4_2 9 | #define __MY_INTEGRAL_4_2 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_4_2(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_4_3.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_4_3 9 | #define __MY_INTEGRAL_4_3 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_4_3(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/src/integral_4_4.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #ifndef __MY_INTEGRAL_4_4 9 | #define __MY_INTEGRAL_4_4 10 | 11 | #include "../include/cpu/integral_data_types.hpp" 12 | namespace XCPU { 13 | void integral_4_4(size_t npts, 14 | double *points, 15 | point rA, 16 | point rB, 17 | int nprim_pairs, 18 | prim_pair *prim_pairs, 19 | double *Xi, 20 | double *Xj, 21 | int ldX, 22 | double *Gi, 23 | double *Gj, 24 | int ldG, 25 | double *weights, 26 | double *boys_table); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/obara_saika/test/Makefile: -------------------------------------------------------------------------------- 1 | #LIBINT_ROOT = /global/cfs/cdirs/m1027/dbwy/mpqc4/li/install/haswell/release 2 | #EIGEN_DIR = /global/common/sw/cray/cnl7/haswell/eigen/3.3.7/gcc/8.2.0/2wwrykb/include/eigen3 3 | 4 | CC = g++ 5 | 6 | CONST_LIB = ../../../../../../include/ 7 | LIBINT_ROOT = /home/dtpopovici/Executables/libint 8 | EIGEN_DIR = /usr/include/eigen3 9 | 10 | #CONST_LIB = ../../../../../../include/ 11 | #LIBINT_ROOT = /global/homes/t/thom13/Executables/libint_gnu/ 12 | #EIGEN_DIR = /global/homes/t/thom13/Executables/Eigen/include/eigen3/ 13 | 14 | compile: 15 | $(CC) test_experimental.cxx ../obara_saika.a $(LIBINT_ROOT)/lib/libint2.a -o test_experimental.x -I$(CONST_LIB) -I$(LIBINT_ROOT)/include -I$(EIGEN_DIR) -I../include/ -std=c++1z 16 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/reference/weights.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "host/local_host_work_driver_pimpl.hpp" 9 | 10 | namespace GauXC { 11 | 12 | using task_iterator = detail::LocalHostWorkDriverPIMPL::task_iterator; 13 | 14 | void reference_ssf_weights_host( 15 | const Molecule& mol, 16 | const MolMeta& meta, 17 | task_iterator task_begin, 18 | task_iterator task_end 19 | ); 20 | 21 | void reference_becke_weights_host( 22 | const Molecule& mol, 23 | const MolMeta& meta, 24 | task_iterator task_begin, 25 | task_iterator task_end 26 | ); 27 | 28 | void reference_lko_weights_host( 29 | const Molecule& mol, 30 | const MolMeta& meta, 31 | task_iterator task_begin, 32 | task_iterator task_end 33 | ); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | set( GAUXC_RYS_HOST_SRC 9 | src/boys_table.c 10 | src/jacobi_table.c 11 | src/rys_1rw.c 12 | src/rys_2rw.c 13 | src/rys_3rw.c 14 | src/rys_4rw.c 15 | src/rys_5rw.c 16 | src/rys_integral.c 17 | src/rys_rw.c 18 | src/rys_xrw.c ) 19 | 20 | target_sources( gauxc PRIVATE ${GAUXC_RYS_HOST_SRC} ) 21 | target_include_directories( gauxc PRIVATE 22 | $ 23 | ) 24 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/Makefile: -------------------------------------------------------------------------------- 1 | AR = ar 2 | ARFLAGS = -rc 3 | 4 | CC=gcc 5 | CFLAGS=-Wall -O2 -lm -mavx 6 | 7 | SRC=./src 8 | INCLUDE=./include 9 | TEST=./test 10 | 11 | #DEBUG= 12 | DEBUG=-DDEBUG 13 | 14 | compile: 15 | $(CC) -c $(SRC)/boys_table.c -o $(SRC)/boys_table.o $(CFLAGS) 16 | $(CC) -c $(SRC)/jacobi_table.c -o $(SRC)/jacobi_table.o $(CFLAGS) 17 | 18 | $(CC) -c $(SRC)/rys_1rw.c -o $(SRC)/rys_1rw.o $(CFLAGS) 19 | $(CC) -c $(SRC)/rys_2rw.c -o $(SRC)/rys_2rw.o $(CFLAGS) 20 | $(CC) -c $(SRC)/rys_3rw.c -o $(SRC)/rys_3rw.o $(CFLAGS) 21 | $(CC) -c $(SRC)/rys_4rw.c -o $(SRC)/rys_4rw.o $(CFLAGS) 22 | $(CC) -c $(SRC)/rys_5rw.c -o $(SRC)/rys_5rw.o $(CFLAGS) 23 | $(CC) -c $(SRC)/rys_xrw.c -o $(SRC)/rys_xrw.o $(CFLAGS) 24 | 25 | $(CC) -c $(SRC)/rys_rw.c -o $(SRC)/rys_rw.o $(CFLAGS) 26 | $(CC) -c $(SRC)/rys_integral.c -o $(SRC)/rys_integral.o $(CFLAGS) -I$(INCLUDE) 27 | 28 | $(AR) $(ARFLAGS) ./rys_integral.a $(SRC)/*.o 29 | 30 | test: compile 31 | $(CC) -o $(TEST)/test_int_v0.x $(TEST)/test_int_v0.c ./rys_integral.a $(CFLAGS) -I$(INCLUDE) $(DEBUG) 32 | 33 | 34 | clean: 35 | rm -rf ./*.a $(SRC)/*.o $(TEST)/*.x 36 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/include/rys_integral.h: -------------------------------------------------------------------------------- 1 | #ifndef __RYS_INTEGRALS 2 | #define __RYS_INTEGRALS 3 | 4 | typedef struct { 5 | double x, y, z; 6 | } point; 7 | 8 | typedef struct { 9 | double alpha, coeff; 10 | } coefficients; 11 | 12 | typedef struct { 13 | point origin; 14 | coefficients *coeff; 15 | int m, L; 16 | } shells; 17 | 18 | typedef struct { 19 | point P; 20 | point PA; 21 | point PB; 22 | 23 | double K; 24 | double gamma; 25 | double coeff_prod; 26 | } prim_pair; 27 | 28 | typedef struct { 29 | int lA; 30 | int lB; 31 | int nprim_pair; 32 | point rAB; 33 | prim_pair* prim_pairs; 34 | } shell_pair; 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | void compute_integral(int n, shells *shell_list, int m, point *points, double *output); 40 | void compute_integral_shell_pair( int npts, shells sh0, shells sh1, 41 | point *points, double* matrix ); 42 | void compute_integral_shell_pair_pre( int npts, shell_pair shpair, 43 | point* points, double* matrix ); 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/src/boys.h: -------------------------------------------------------------------------------- 1 | #ifndef BOYS_H_ 2 | #define BOYS_H_ 3 | 4 | #include 5 | 6 | #define NGRID 920 7 | #define MGRID 10 8 | 9 | static const double tmax = 46.0; 10 | static const double tvstep = 20.0; 11 | static const double tstep = 0.05; 12 | 13 | extern double boys_table[NGRID + 1][MGRID + 1]; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/src/jacobi.h: -------------------------------------------------------------------------------- 1 | #ifndef JACOBI_H_ 2 | #define JACOBI_H_ 3 | 4 | /* (2i+1) / ((4i-1) * (4i+3)) for i = 1...100 */ 5 | extern const double r2[100]; 6 | 7 | /* ((4i-3) * (4i+1) * square(4i-1)) / (2i * (2i+1) * square(2i-1)) for i = 1...100 */ 8 | extern const double sinv[100]; 9 | 10 | extern const double csmall[16]; 11 | 12 | /* (4i * (2i+1) - 1) / ((4i+3) * (4i-1)) for i = 0...99 */ 13 | extern const double ajac[100]; 14 | 15 | /* (4*square(i) * (4*square(i) - 4*i + 1)) / ((4i-3) * (4i+1) * square(4i-1)) for i = 1...99 */ 16 | extern const double bjac[99]; 17 | 18 | #endif // JACOBI_H_ 19 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/src/rys_1rw.h: -------------------------------------------------------------------------------- 1 | #ifndef RYS_1RW_H_ 2 | #define RYS_1RW_H_ 3 | 4 | void rys_1rw(int nt, const double tval[restrict], double rts[restrict], double wts[restrict]); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/src/rys_2rw.h: -------------------------------------------------------------------------------- 1 | #ifndef RYS_2RW_H_ 2 | #define RYS_2RW_H_ 3 | 4 | void rys_2rw(int nt, const double tval[restrict], double rts[restrict], double wts[restrict]); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/src/rys_3rw.h: -------------------------------------------------------------------------------- 1 | #ifndef RYS_3RW_H_ 2 | #define RYS_3RW_H_ 3 | 4 | void rys_3rw(int nt, const double tval[restrict], double rts[restrict], double wts[restrict]); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/src/rys_4rw.h: -------------------------------------------------------------------------------- 1 | #ifndef RYS_4RW_H_ 2 | #define RYS_4RW_H_ 3 | 4 | void rys_4rw(int nt, const double tval[restrict], double rts[restrict], double wts[restrict]); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/src/rys_5rw.h: -------------------------------------------------------------------------------- 1 | #ifndef RYS_5RW_H_ 2 | #define RYS_5RW_H_ 3 | 4 | void rys_5rw(int nt, const double tval[restrict], double rts[restrict], double wts[restrict]); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/src/rys_rw.h: -------------------------------------------------------------------------------- 1 | #ifndef RYS_RW_H_ 2 | #define RYS_RW_H_ 3 | 4 | void rys_rw(int nt, int ngqp, double tval[restrict], double rts[restrict], double wts[restrict]); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/src/rys_xrw.h: -------------------------------------------------------------------------------- 1 | #ifndef RYS_XRW_H_ 2 | #define RYS_XRW_H_ 3 | 4 | void rys_xrw(int nt, 5 | int ntgqp, 6 | int ngqp, 7 | int nmom, 8 | const double tval[restrict], 9 | const double ryszero[restrict], 10 | double rts[restrict], 11 | double wts[restrict]); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/xc_integrator/local_work_driver/host/rys/test/test_points.txt: -------------------------------------------------------------------------------- 1 | 2 2 | -1.46097,0.186863,-0.00156859 3 | -1.46097,0.186863,-0.00156859 4 | -------------------------------------------------------------------------------- /src/xc_integrator/replicated/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE 9 | replicated_xc_integrator_impl.cxx 10 | ) 11 | 12 | add_subdirectory(host) 13 | 14 | if(GAUXC_HAS_DEVICE) 15 | add_subdirectory(device) 16 | endif() 17 | 18 | target_include_directories( gauxc 19 | PUBLIC 20 | $ 21 | ) 22 | -------------------------------------------------------------------------------- /src/xc_integrator/replicated/device/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE 9 | replicated_xc_device_integrator.cxx 10 | incore_replicated_xc_device_integrator.cxx 11 | shell_batched_replicated_xc_device_integrator.cxx 12 | ) 13 | 14 | -------------------------------------------------------------------------------- /src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "incore_replicated_xc_device_integrator_integrate_den.hpp" 9 | #include "incore_replicated_xc_device_integrator_exc.hpp" 10 | #include "incore_replicated_xc_device_integrator_exc_vxc.hpp" 11 | #include "incore_replicated_xc_device_integrator_exc_grad.hpp" 12 | #include "incore_replicated_xc_device_integrator_exx.hpp" 13 | 14 | namespace GauXC { 15 | namespace detail { 16 | 17 | template 18 | IncoreReplicatedXCDeviceIntegrator::~IncoreReplicatedXCDeviceIntegrator() noexcept = default; 19 | 20 | 21 | 22 | template class IncoreReplicatedXCDeviceIntegrator; 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/xc_integrator/replicated/device/shell_batched_replicated_xc_device_integrator.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "shell_batched_replicated_xc_device_integrator.hpp" 9 | #include "shell_batched_replicated_xc_integrator_integrate_den.hpp" 10 | #include "shell_batched_replicated_xc_integrator_exc.hpp" 11 | #include "shell_batched_replicated_xc_integrator_exc_vxc.hpp" 12 | #include "shell_batched_replicated_xc_integrator_exc_grad.hpp" 13 | #include "shell_batched_replicated_xc_integrator_exx.hpp" 14 | 15 | namespace GauXC { 16 | namespace detail { 17 | 18 | template 19 | ShellBatchedReplicatedXCDeviceIntegrator::~ShellBatchedReplicatedXCDeviceIntegrator() noexcept = default; 20 | 21 | template class ShellBatchedReplicatedXCDeviceIntegrator; 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/xc_integrator/replicated/host/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE 9 | replicated_xc_host_integrator.cxx 10 | reference_replicated_xc_host_integrator.cxx 11 | shell_batched_replicated_xc_host_integrator.cxx 12 | ) 13 | 14 | -------------------------------------------------------------------------------- /src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "reference_replicated_xc_host_integrator_integrate_den.hpp" 9 | #include "reference_replicated_xc_host_integrator_exc.hpp" 10 | #include "reference_replicated_xc_host_integrator_exc_vxc.hpp" 11 | #include "reference_replicated_xc_host_integrator_exc_grad.hpp" 12 | #include "reference_replicated_xc_host_integrator_exx.hpp" 13 | 14 | namespace GauXC::detail { 15 | 16 | template 17 | ReferenceReplicatedXCHostIntegrator::~ReferenceReplicatedXCHostIntegrator() noexcept = default; 18 | 19 | template class ReferenceReplicatedXCHostIntegrator; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/xc_integrator/replicated/host/shell_batched_replicated_xc_host_integrator.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "shell_batched_replicated_xc_host_integrator.hpp" 9 | #include "shell_batched_replicated_xc_integrator_integrate_den.hpp" 10 | #include "shell_batched_replicated_xc_integrator_exc.hpp" 11 | #include "shell_batched_replicated_xc_integrator_exc_vxc.hpp" 12 | #include "shell_batched_replicated_xc_integrator_exc_grad.hpp" 13 | #include "shell_batched_replicated_xc_integrator_exx.hpp" 14 | 15 | namespace GauXC { 16 | namespace detail { 17 | 18 | template 19 | ShellBatchedReplicatedXCHostIntegrator::~ShellBatchedReplicatedXCHostIntegrator() noexcept = default; 20 | 21 | template class ShellBatchedReplicatedXCHostIntegrator; 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/xc_integrator/replicated/host/xc_host_data.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | namespace GauXC { 15 | 16 | template 17 | struct XCHostData { 18 | 19 | std::vector eps; 20 | std::vector gamma; 21 | std::vector tau; 22 | std::vector lapl; 23 | std::vector vrho; 24 | std::vector vgamma; 25 | std::vector vtau; 26 | std::vector vlapl; 27 | 28 | std::vector zmat; 29 | std::vector gmat; 30 | std::vector nbe_scr; 31 | std::vector den_scr; 32 | std::vector basis_eval; 33 | 34 | inline XCHostData() {} 35 | 36 | }; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/xc_integrator/shell_batched/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE shell_batched_xc_integrator.cxx ) 9 | target_include_directories( gauxc 10 | PUBLIC 11 | $ 12 | ) 13 | -------------------------------------------------------------------------------- /src/xc_integrator/shell_batched/shell_batched_replicated_xc_integrator_exc_grad.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "shell_batched_replicated_xc_integrator.hpp" 10 | #include 11 | #include 12 | 13 | namespace GauXC { 14 | namespace detail { 15 | 16 | template 17 | void ShellBatchedReplicatedXCIntegrator:: 18 | eval_exc_grad_( int64_t m, int64_t n, const value_type* P, 19 | int64_t ldp, value_type* EXC_GRAD ) { 20 | 21 | GAUXC_GENERIC_EXCEPTION("ShellBatched exc_grad NYI" ); 22 | util::unused(m,n,P,ldp,EXC_GRAD); 23 | } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/xc_integrator/shell_batched/shell_batched_replicated_xc_integrator_exx.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "shell_batched_replicated_xc_integrator.hpp" 10 | #include 11 | #include 12 | 13 | namespace GauXC { 14 | namespace detail { 15 | 16 | template 17 | void ShellBatchedReplicatedXCIntegrator:: 18 | eval_exx_( int64_t m, int64_t n, const value_type* P, 19 | int64_t ldp, value_type* K, int64_t ldk, 20 | const IntegratorSettingsEXX& settings ) { 21 | GAUXC_GENERIC_EXCEPTION("ShellBatched EXX NYI"); 22 | util::unused(m,n,P,ldp,K,ldk,settings); 23 | } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/xc_integrator/shell_batched/shell_batched_replicated_xc_integrator_integrate_den.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include "shell_batched_replicated_xc_integrator.hpp" 10 | #include 11 | #include 12 | 13 | namespace GauXC { 14 | namespace detail { 15 | 16 | template 17 | void ShellBatchedReplicatedXCIntegrator:: 18 | integrate_den_( int64_t m, int64_t n, const value_type* P, 19 | int64_t ldp, value_type* N_EL ) { 20 | 21 | GAUXC_GENERIC_EXCEPTION("ShellBatched integrate_den NYI" ); 22 | util::unused(m,n,P,ldp,N_EL); 23 | } 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/xc_integrator/shell_batched/shell_batched_xc_integrator.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | #include 11 | 12 | namespace GauXC { 13 | namespace detail { 14 | 15 | struct ShellBatchedXCIntegratorBase { 16 | 17 | using basis_type = BasisSet; 18 | 19 | using host_task_container = std::vector; 20 | using host_task_iterator = typename host_task_container::iterator; 21 | 22 | // Struct to manage data associated with task subset to execute in batch 23 | struct incore_task_data { 24 | host_task_iterator task_begin; 25 | host_task_iterator task_end; 26 | std::vector shell_list; 27 | }; 28 | 29 | incore_task_data generate_incore_task( 30 | uint32_t nbf_threshold, const basis_type& basis, 31 | host_task_iterator task_begin, host_task_iterator task_end ); 32 | 33 | virtual ~ShellBatchedXCIntegratorBase() noexcept = default; 34 | 35 | }; 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/xc_integrator/xc_data/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | if(GAUXC_HAS_DEVICE) 9 | add_subdirectory( device ) 10 | target_include_directories( gauxc 11 | PUBLIC 12 | $ 13 | ) 14 | endif() 15 | -------------------------------------------------------------------------------- /src/xc_integrator/xc_data/device/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | target_sources( gauxc PRIVATE xc_device_stack_data.cxx xc_device_aos_data.cxx ) 9 | -------------------------------------------------------------------------------- /src/xc_integrator/xc_data/device/xc_device_shell_pair_soa.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #pragma once 9 | #include 10 | 11 | namespace GauXC { 12 | struct XCDeviceShellPairSoA { 13 | using shell_pair = ShellPair; 14 | using point = detail::cartesian_point; 15 | std::vector*> prim_pair_dev_ptr; 16 | std::vector shell_pair_nprim_pairs; 17 | std::vector> shell_pair_shidx; 18 | std::vector> shell_pair_ls; 19 | std::vector> shell_pair_centers; 20 | 21 | std::vector sp_row_ptr; 22 | std::vector sp_col_ind; 23 | 24 | inline void reset() { 25 | shell_pair_nprim_pairs.clear(); 26 | prim_pair_dev_ptr.clear(); 27 | shell_pair_ls.clear(); 28 | shell_pair_centers.clear(); 29 | } 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /tests/basis/parse_basis.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include 9 | #include 10 | #include 11 | 12 | namespace GauXC { 13 | 14 | BasisSet parse_basis( const Molecule& mol, 15 | std::string fname, 16 | SphericalType sph ); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /tests/cmake/discovery/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | # through Lawrence Berkeley National Laboratory (subject to receipt of 4 | # any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | # 6 | # See LICENSE.txt for details 7 | # 8 | cmake_minimum_required( VERSION 3.18 FATAL_ERROR ) 9 | project( gauxc_cmake_discovery LANGUAGES CXX ) 10 | 11 | find_package( gauxc REQUIRED ) 12 | add_executable( gauxc_link_tester gauxc_link_tester.cxx ) 13 | target_link_libraries( gauxc_link_tester PUBLIC gauxc::gauxc ) 14 | -------------------------------------------------------------------------------- /tests/cmake/discovery/gauxc_link_tester.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include 9 | int main() { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/cmake/subproject/gauxc_link_tester.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include 9 | int main() { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /tests/ref_data/benzene_631gd_pbe0_ufg.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_631gd_pbe0_ufg.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/benzene_cc-pvdz_ufg_tasks_1mpi_rank0_pv1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_cc-pvdz_ufg_tasks_1mpi_rank0_pv1.bin -------------------------------------------------------------------------------- /tests/ref_data/benzene_cc-pvdz_ufg_tasks_1mpi_rank0_pv32.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_cc-pvdz_ufg_tasks_1mpi_rank0_pv32.bin -------------------------------------------------------------------------------- /tests/ref_data/benzene_cc-pvdz_ufg_tasks_2mpi_rank0_pv1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_cc-pvdz_ufg_tasks_2mpi_rank0_pv1.bin -------------------------------------------------------------------------------- /tests/ref_data/benzene_cc-pvdz_ufg_tasks_2mpi_rank0_pv32.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_cc-pvdz_ufg_tasks_2mpi_rank0_pv32.bin -------------------------------------------------------------------------------- /tests/ref_data/benzene_cc-pvdz_ufg_tasks_2mpi_rank1_pv1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_cc-pvdz_ufg_tasks_2mpi_rank1_pv1.bin -------------------------------------------------------------------------------- /tests/ref_data/benzene_cc-pvdz_ufg_tasks_2mpi_rank1_pv32.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_cc-pvdz_ufg_tasks_2mpi_rank1_pv32.bin -------------------------------------------------------------------------------- /tests/ref_data/benzene_pbe0_cc-pvdz_ufg_ssf.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_pbe0_cc-pvdz_ufg_ssf.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/benzene_svwn5_cc-pvdz_ufg_ssf.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_svwn5_cc-pvdz_ufg_ssf.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/benzene_svwn5_cc-pvdz_ufg_ssf_robust_prune.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_svwn5_cc-pvdz_ufg_ssf_robust_prune.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/benzene_svwn5_cc-pvdz_ufg_ssf_treutler_prune.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_svwn5_cc-pvdz_ufg_ssf_treutler_prune.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/benzene_weights_becke.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_weights_becke.bin -------------------------------------------------------------------------------- /tests/ref_data/benzene_weights_lko.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_weights_lko.bin -------------------------------------------------------------------------------- /tests/ref_data/benzene_weights_ssf.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/benzene_weights_ssf.bin -------------------------------------------------------------------------------- /tests/ref_data/cytosine_r2scanl_cc-pvdz_ufg_ssf_robust.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/cytosine_r2scanl_cc-pvdz_ufg_ssf_robust.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/cytosine_r2scanl_cc-pvdz_ufg_ssf_robust_uks.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/cytosine_r2scanl_cc-pvdz_ufg_ssf_robust_uks.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/cytosine_scan_cc-pvdz_ufg_ssf_robust.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/cytosine_scan_cc-pvdz_ufg_ssf_robust.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/cytosine_scan_cc-pvdz_ufg_ssf_robust_uks.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/cytosine_scan_cc-pvdz_ufg_ssf_robust_uks.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/h2o2_def2-qzvp.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/h2o2_def2-qzvp.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/h2o2_def2-tzvp.hdf5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/h2o2_def2-tzvp.hdf5 -------------------------------------------------------------------------------- /tests/ref_data/h3_blyp_cc-pvdz_ssf_gks.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/h3_blyp_cc-pvdz_ssf_gks.bin -------------------------------------------------------------------------------- /tests/ref_data/li_blyp_sto3g_uks.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/li_blyp_sto3g_uks.bin -------------------------------------------------------------------------------- /tests/ref_data/li_svwn5_sto3g_uks.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/li_svwn5_sto3g_uks.bin -------------------------------------------------------------------------------- /tests/ref_data/ut_input.inp: -------------------------------------------------------------------------------- 1 | [GAUXC] 2 | ref_file = benzene_svwn5_cc-pvdz_ufg_ssf.hdf5 3 | grid = UltraFine 4 | pruning_scheme = Robust 5 | batch_size = 512 6 | basis_tol = 2.22e-16 7 | func = svwn5 8 | integrate_vxc = TRUE 9 | integrate_exc_grad = TRUE 10 | integrate_exx = FALSE 11 | OUTFILE = benzene_svwn5_cc-pvdz_ufg_ssf_robust_prune.hdf5 12 | -------------------------------------------------------------------------------- /tests/ref_data/water_cc-pVDZ_collocation.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wavefunction91/GauXC/71008cffd5d13d5ee813fb13d14d8bf7b06b8f6e/tests/ref_data/water_cc-pVDZ_collocation.bin -------------------------------------------------------------------------------- /tests/standards.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include 9 | #include 10 | 11 | namespace GauXC { 12 | 13 | Molecule make_water(); 14 | Molecule make_benzene(); 15 | Molecule make_ubiquitin(); 16 | Molecule make_taxol(); 17 | BasisSet make_631Gd( const Molecule&, SphericalType ); 18 | BasisSet make_ccpvdz( const Molecule&, SphericalType ); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /tests/ut_common.hpp.in: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #include "catch2/catch.hpp" 9 | #include "standards.hpp" 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include "eigen3_matrix_serialization.hpp" 18 | 19 | #cmakedefine GAUXC_REF_DATA_PATH "@GAUXC_REF_DATA_PATH@" 20 | -------------------------------------------------------------------------------- /tests/ut_main.cxx: -------------------------------------------------------------------------------- 1 | /** 2 | * GauXC Copyright (c) 2020-2024, The Regents of the University of California, 3 | * through Lawrence Berkeley National Laboratory (subject to receipt of 4 | * any required approvals from the U.S. Dept. of Energy). All rights reserved. 5 | * 6 | * See LICENSE.txt for details 7 | */ 8 | #define CATCH_CONFIG_RUNNER 9 | #include "catch2/catch.hpp" 10 | #include 11 | 12 | #ifdef GAUXC_HAS_MPI 13 | #include 14 | #endif 15 | 16 | int main( int argc, char* argv[] ) { 17 | #ifdef GAUXC_HAS_MPI 18 | MPI_Init(&argc, &argv); 19 | int result = Catch::Session().run( argc, argv ); 20 | MPI_Finalize(); 21 | #else 22 | int result = Catch::Session().run( argc, argv ); 23 | #endif 24 | return result; 25 | } 26 | --------------------------------------------------------------------------------